Merge branch 'experiment/crd_configuration' of github.com:zalando-incubator/postgres-operator into experiment/crd_configuration
This commit is contained in:
		
						commit
						6bebb87d8f
					
				|  | @ -15,8 +15,8 @@ configuration: | ||||||
|   kubernetes: |   kubernetes: | ||||||
|     pod_service_account_name: operator |     pod_service_account_name: operator | ||||||
|     pod_terminate_grace_period: 5m |     pod_terminate_grace_period: 5m | ||||||
|     pdb_name_format: postgres-{cluster}-pdb |     pdb_name_format: "postgres-{cluster}-pdb" | ||||||
|     secret_name_template: {username}.{cluster}.credentials.{tprkind}.{tprgroup} |     secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}" | ||||||
|     oauth_token_secret_name: postgresql-operator |     oauth_token_secret_name: postgresql-operator | ||||||
|     pod_role_label: spilo-role |     pod_role_label: spilo-role | ||||||
|     cluster_labels: |     cluster_labels: | ||||||
|  | @ -30,7 +30,7 @@ configuration: | ||||||
|   postgres_pod_resources: |   postgres_pod_resources: | ||||||
|     default_cpu_request: 100m |     default_cpu_request: 100m | ||||||
|     default_memory_request: 100Mi |     default_memory_request: 100Mi | ||||||
|     default_cpu_limit: 3 |     default_cpu_limit: "3" | ||||||
|     default_memory_limit: 1Gi |     default_memory_limit: 1Gi | ||||||
|   timeouts: |   timeouts: | ||||||
|     resource_check_interval: 3s |     resource_check_interval: 3s | ||||||
|  | @ -42,8 +42,8 @@ configuration: | ||||||
|   load_balancer: |   load_balancer: | ||||||
|     enable_master_load_balancer: false |     enable_master_load_balancer: false | ||||||
|     enable_replica_load_balancer: false |     enable_replica_load_balancer: false | ||||||
|     master_dns_name_format: {cluster}.{team}.{hostedzone} |     master_dns_name_format: "{cluster}.{team}.{hostedzone}" | ||||||
|     replica_dns_name_format: {cluster}-repl.{team}.{hostedzone} |     replica_dns_name_format: "{cluster}-repl.{team}.{hostedzone}" | ||||||
|   aws_or_gcp: |   aws_or_gcp: | ||||||
|     # db_hosted_zone: "" |     # db_hosted_zone: "" | ||||||
|     # wal_s3_bucket: ""  |     # wal_s3_bucket: ""  | ||||||
|  |  | ||||||
|  | @ -169,7 +169,7 @@ func (c *Controller) initController() { | ||||||
| 		if err := c.createOperatorCRD(); err != nil { | 		if err := c.createOperatorCRD(); err != nil { | ||||||
| 			c.logger.Fatalf("could not register Operator Configuration CustomResourceDefinition: %v", err) | 			c.logger.Fatalf("could not register Operator Configuration CustomResourceDefinition: %v", err) | ||||||
| 		} | 		} | ||||||
| 		if cfg, err := c.readOperatorConfigurationFromCRD(configObjectName); err != nil { | 		if cfg, err := c.readOperatorConfigurationFromCRD(spec.GetOperatorNamespace(), configObjectName); err != nil { | ||||||
| 			c.logger.Fatalf("unable to read operator configuration: %v", err) | 			c.logger.Fatalf("unable to read operator configuration: %v", err) | ||||||
| 		} else { | 		} else { | ||||||
| 			c.opConfig = c.importConfigurationFromCRD(&cfg.Configuration) | 			c.opConfig = c.importConfigurationFromCRD(&cfg.Configuration) | ||||||
|  |  | ||||||
|  | @ -9,14 +9,14 @@ import ( | ||||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func (c *Controller) readOperatorConfigurationFromCRD(configObjectName string) (*config.OperatorConfiguration, error) { | func (c *Controller) readOperatorConfigurationFromCRD(configObjectNamespace, configObjectName string) (*config.OperatorConfiguration, error) { | ||||||
| 	var ( | 	var ( | ||||||
| 		config config.OperatorConfiguration | 		config config.OperatorConfiguration | ||||||
| 	) | 	) | ||||||
| 
 | 
 | ||||||
| 	req := c.KubeClient.CRDREST.Get(). | 	req := c.KubeClient.CRDREST.Get(). | ||||||
| 		Name(configObjectName). | 		Name(configObjectName). | ||||||
| 		Namespace(c.opConfig.WatchedNamespace). | 		Namespace(configObjectNamespace). | ||||||
| 		Resource(constants.OperatorConfigCRDResource). | 		Resource(constants.OperatorConfigCRDResource). | ||||||
| 		VersionedParams(&metav1.ListOptions{ResourceVersion: "0"}, metav1.ParameterCodec) | 		VersionedParams(&metav1.ListOptions{ResourceVersion: "0"}, metav1.ParameterCodec) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue