define new variables
This commit is contained in:
		
							parent
							
								
									766597980f
								
							
						
					
					
						commit
						8b79e33b1c
					
				|  | @ -327,6 +327,12 @@ spec: | |||
|                   pod_role_label: | ||||
|                     type: string | ||||
|                     default: "spilo-role" | ||||
|                   pod_leader_label_value: | ||||
|                     type: string | ||||
|                     default: "master" | ||||
|                   pod_standby_leader_label_value: | ||||
|                     type: string | ||||
|                     default: "master" | ||||
|                   pod_service_account_definition: | ||||
|                     type: string | ||||
|                     default: "" | ||||
|  |  | |||
|  | @ -194,6 +194,8 @@ configKubernetes: | |||
|   pod_management_policy: "ordered_ready" | ||||
|   # label assigned to the Postgres pods (and services/endpoints) | ||||
|   pod_role_label: spilo-role | ||||
|   pod_leader_label_value: master | ||||
|   pod_standby_leader_label_value: master | ||||
|   # service account definition as JSON/YAML string to be used by postgres cluster pods | ||||
|   # pod_service_account_definition: "" | ||||
| 
 | ||||
|  |  | |||
|  | @ -437,6 +437,14 @@ configuration they are grouped under the `kubernetes` key. | |||
|   name of the label assigned to the Postgres pods (and services/endpoints) by | ||||
|   the operator. The default is `spilo-role`. | ||||
| 
 | ||||
| * **pod_leader_label_value** | ||||
|   value of the pod label if Postgres role is primary when running on Kubernetes. | ||||
|   The default is 'master'. | ||||
| 
 | ||||
| * **pod_standby_leader_label_value** | ||||
|   value of the pod label if Postgres role is standby_leader when running on Kubernetes. | ||||
|   The default is 'master'. | ||||
| 
 | ||||
| * **cluster_labels** | ||||
|   list of `name:value` pairs for additional labels assigned to the cluster | ||||
|   objects. The default is `application:spilo`. | ||||
|  |  | |||
|  | @ -12,9 +12,9 @@ from kubernetes import client | |||
| from tests.k8s_api import K8s | ||||
| from kubernetes.client.rest import ApiException | ||||
| 
 | ||||
| SPILO_CURRENT = "container-registry-test.zalando.net/acid/spilo-cdp-pr1050-16:4.0-p4" | ||||
| SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-16-e2e:0.1" | ||||
| SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-16-e2e:0.2" | ||||
| SPILO_FULL_IMAGE = "container-registry-test.zalando.net/acid/spilo-cdp-pr1050-16:4.0-p4" | ||||
| SPILO_FULL_IMAGE = "ghcr.io/zalando/spilo-16:3.2-p3" | ||||
| 
 | ||||
| 
 | ||||
| def to_selector(labels): | ||||
|  |  | |||
|  | @ -135,7 +135,7 @@ data: | |||
|   # pod_priority_class_name: "postgres-pod-priority" | ||||
|   pod_role_label: spilo-role | ||||
|   pod_leader_label_value: master | ||||
|   pod_standby_leader_label_value: standby_leader | ||||
|   pod_standby_leader_label_value: master | ||||
|   pod_service_account_definition: "" | ||||
|   pod_service_account_name: "postgres-pod" | ||||
|   pod_service_account_role_binding_definition: "" | ||||
|  |  | |||
|  | @ -325,6 +325,12 @@ spec: | |||
|                   pod_role_label: | ||||
|                     type: string | ||||
|                     default: "spilo-role" | ||||
|                   pod_leader_label_value: | ||||
|                     type: string | ||||
|                     default: "master" | ||||
|                   pod_standby_leader_label_value: | ||||
|                     type: string | ||||
|                     default: "master" | ||||
|                   pod_service_account_definition: | ||||
|                     type: string | ||||
|                     default: "" | ||||
|  |  | |||
|  | @ -99,6 +99,8 @@ configuration: | |||
|     pod_management_policy: "ordered_ready" | ||||
|     # pod_priority_class_name: "postgres-pod-priority" | ||||
|     pod_role_label: spilo-role | ||||
|     pod_leader_label_value: master | ||||
|     pod_standby_leader_label_value: master | ||||
|     # pod_service_account_definition: "" | ||||
|     pod_service_account_name: postgres-pod | ||||
|     # pod_service_account_role_binding_definition: "" | ||||
|  |  | |||
|  | @ -1497,6 +1497,12 @@ var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{ | |||
| 							"pod_role_label": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_leader_label_value": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_standby_leader_label_value": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_service_account_definition": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
|  |  | |||
|  | @ -81,6 +81,8 @@ type KubernetesMetaConfiguration struct { | |||
| 	InfrastructureRolesSecretName          spec.NamespacedName          `json:"infrastructure_roles_secret_name,omitempty"` | ||||
| 	InfrastructureRolesDefs                []*config.InfrastructureRole `json:"infrastructure_roles_secrets,omitempty"` | ||||
| 	PodRoleLabel                           string                       `json:"pod_role_label,omitempty"` | ||||
| 	PodLeaderLabelValue                    string                       `json:"pod_leader_label_value,omitempty"` | ||||
| 	PodStandbyLeaderLabelValue             string                       `json:"pod_standby_leader_label_value,omitempty"` | ||||
| 	ClusterLabels                          map[string]string            `json:"cluster_labels,omitempty"` | ||||
| 	InheritedLabels                        []string                     `json:"inherited_labels,omitempty"` | ||||
| 	InheritedAnnotations                   []string                     `json:"inherited_annotations,omitempty"` | ||||
|  |  | |||
|  | @ -950,6 +950,14 @@ func (c *Cluster) generateSpiloPodEnvVars( | |||
| 			Name:  "KUBERNETES_ROLE_LABEL", | ||||
| 			Value: c.OpConfig.PodRoleLabel, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Name:  "KUBERNETES_LEADER_LABEL_VALUE", | ||||
| 			Value: c.OpConfig.PodLeaderLabelValue, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Name: "KUBERNETES_STANDBY_LEADER_LABEL_VALUE", | ||||
| 			Value: c.OpConfig.PodStandbyLeaderLabelValue, | ||||
| 		} | ||||
| 		{ | ||||
| 			Name: "PGPASSWORD_SUPERUSER", | ||||
| 			ValueFrom: &v1.EnvVarSource{ | ||||
|  |  | |||
|  | @ -48,6 +48,8 @@ type Resources struct { | |||
| 	DeleteAnnotationDateKey       string              `name:"delete_annotation_date_key"` | ||||
| 	DeleteAnnotationNameKey       string              `name:"delete_annotation_name_key"` | ||||
| 	PodRoleLabel                  string              `name:"pod_role_label" default:"spilo-role"` | ||||
| 	PodLeaderLabelValue           string              `name:"pod_leader_label_value" default:"master"` | ||||
| 	PodStandbyLeaderLabelValue    string              `name:"pod_standby_leader_label_value" default:"master"` | ||||
| 	PodToleration                 map[string]string   `name:"toleration" default:""` | ||||
| 	DefaultCPURequest             string              `name:"default_cpu_request"` | ||||
| 	DefaultMemoryRequest          string              `name:"default_memory_request"` | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue