some final polishing
This commit is contained in:
		
							parent
							
								
									c9ea5856af
								
							
						
					
					
						commit
						22978eddf8
					
				|  | @ -117,6 +117,10 @@ spec: | |||
|                   type: object | ||||
|                   additionalProperties: | ||||
|                     type: string | ||||
|                 downscaler_annotations: | ||||
|                   type: array | ||||
|                   items: | ||||
|                     type: string | ||||
|                 enable_init_containers: | ||||
|                   type: boolean | ||||
|                 enable_pod_antiaffinity: | ||||
|  |  | |||
|  | @ -55,9 +55,6 @@ configUsers: | |||
|   super_username: postgres | ||||
| 
 | ||||
| configKubernetes: | ||||
|   # downscaler_annotations: | ||||
|   #   - deployment-time | ||||
|   #   - downscaler/* | ||||
|   # default DNS domain of K8s cluster where operator is running | ||||
|   cluster_domain: cluster.local | ||||
|   # additional labels assigned to the cluster objects | ||||
|  | @ -70,6 +67,11 @@ configKubernetes: | |||
|   #   keya: valuea | ||||
|   #   keyb: valueb | ||||
| 
 | ||||
|   # list of annotations propagated from cluster manifest to statefulset and deployment  | ||||
|   # downscaler_annotations: | ||||
|   #   - deployment-time | ||||
|   #   - downscaler/* | ||||
| 
 | ||||
|   # enables initContainers to run actions before Spilo is started | ||||
|   enable_init_containers: true | ||||
|   # toggles pod anti affinity on the Postgres pods | ||||
|  |  | |||
|  | @ -54,9 +54,6 @@ configUsers: | |||
|   super_username: postgres | ||||
| 
 | ||||
| configKubernetes: | ||||
|   # downscaler_annotations: | ||||
|   #   - deployment-time | ||||
|   #   - downscaler/* | ||||
|   # default DNS domain of K8s cluster where operator is running | ||||
|   cluster_domain: cluster.local | ||||
|   # additional labels assigned to the cluster objects | ||||
|  | @ -66,6 +63,9 @@ configKubernetes: | |||
|   # annotations attached to each database pod | ||||
|   # custom_pod_annotations: "keya:valuea,keyb:valueb" | ||||
| 
 | ||||
|   # list of annotations propagated from cluster manifest to statefulset and deployment | ||||
|   # downscaler_annotations: "deployment-time,downscaler/*" | ||||
| 
 | ||||
|   # enables initContainers to run actions before Spilo is started | ||||
|   enable_init_containers: "true" | ||||
|   # toggles pod anti affinity on the Postgres pods | ||||
|  |  | |||
|  | @ -151,11 +151,6 @@ Those are top-level keys, containing both leaf keys and groups. | |||
|   [operator deployment manually](../../manifests/postgres-operator.yaml#L20). | ||||
|   The default is `false`. | ||||
| 
 | ||||
| * **downscaler_annotations** | ||||
|   An array of annotations from PostgresCRD that should be passed on to the statefulsets. | ||||
|   This also accepts the regular expression like downscaler/*, etc. | ||||
|   These annotations will also be passed to the connection-pooler deployments if any. | ||||
| 
 | ||||
| ## Postgres users | ||||
| 
 | ||||
| Parameters describing Postgres users. In a CRD-configuration, they are grouped | ||||
|  | @ -205,6 +200,12 @@ configuration they are grouped under the `kubernetes` key. | |||
|   of a database created by the operator. If the annotation key is also provided | ||||
|   by the database definition, the database definition value is used. | ||||
| 
 | ||||
| * **downscaler_annotations** | ||||
|   An array of annotations that should be passed from Postgres CRD on to the | ||||
|   statefulset and, if exists, to the connection pooler deployment as well. | ||||
|   Regular expressions like `downscaler/*` etc. are also accepted. Can be used | ||||
|   with [kube-downscaler](https://github.com/hjacobs/kube-downscaler). | ||||
| 
 | ||||
| * **watched_namespace** | ||||
|   The operator watches for Postgres objects in the given namespace. If not | ||||
|   specified, the value is taken from the operator namespace. A special `*` | ||||
|  |  | |||
|  | @ -30,6 +30,7 @@ data: | |||
|   # default_memory_limit: 500Mi | ||||
|   # default_memory_request: 100Mi | ||||
|   docker_image: registry.opensource.zalan.do/acid/spilo-cdp-12:1.6-p115 | ||||
|   # downscaler_annotations: "deployment-time,downscaler/*" | ||||
|   # enable_admin_role_for_users: "true" | ||||
|   # enable_crd_validation: "true" | ||||
|   # enable_database_access: "true" | ||||
|  | @ -94,7 +95,6 @@ data: | |||
|   # sidecar_docker_images: "" | ||||
|   # set_memory_request_to_limit: "false" | ||||
|   spilo_privileged: "false" | ||||
|   # downscaler_annotations: "deployment-time,downscaler/*" | ||||
|   super_username: postgres | ||||
|   # team_admin_role: "admin" | ||||
|   # team_api_role_configuration: "log_statement:all" | ||||
|  |  | |||
|  | @ -81,10 +81,6 @@ spec: | |||
|             kubernetes: | ||||
|               type: object | ||||
|               properties: | ||||
|                 # downscaler_annotations: | ||||
|                 #   type: array | ||||
|                 #   items: | ||||
|                 #     type: string | ||||
|                 cluster_domain: | ||||
|                   type: string | ||||
|                 cluster_labels: | ||||
|  | @ -97,6 +93,10 @@ spec: | |||
|                   type: object | ||||
|                   additionalProperties: | ||||
|                     type: string | ||||
|                 downscaler_annotations: | ||||
|                   type: array | ||||
|                   items: | ||||
|                     type: string | ||||
|                 enable_init_containers: | ||||
|                   type: boolean | ||||
|                 enable_pod_antiaffinity: | ||||
|  |  | |||
|  | @ -24,9 +24,6 @@ configuration: | |||
|     replication_username: standby | ||||
|     super_username: postgres | ||||
|   kubernetes: | ||||
|     # downscaler_annotations: | ||||
|     #   - deployment-time | ||||
|     #   - downscaler/* | ||||
|     cluster_domain: cluster.local | ||||
|     cluster_labels: | ||||
|       application: spilo | ||||
|  | @ -34,6 +31,9 @@ configuration: | |||
|     # custom_pod_annotations: | ||||
|     #   keya: valuea | ||||
|     #   keyb: valueb | ||||
|     # downscaler_annotations: | ||||
|     # - deployment-time | ||||
|     # - downscaler/* | ||||
|     enable_init_containers: true | ||||
|     enable_pod_antiaffinity: false | ||||
|     enable_pod_disruption_budget: true | ||||
|  |  | |||
|  | @ -62,6 +62,7 @@ type KubernetesMetaConfiguration struct { | |||
| 	PodRoleLabel                           string                `json:"pod_role_label,omitempty"` | ||||
| 	ClusterLabels                          map[string]string     `json:"cluster_labels,omitempty"` | ||||
| 	InheritedLabels                        []string              `json:"inherited_labels,omitempty"` | ||||
| 	DownscalerAnnotations                  []string              `json:"downscaler_annotations,omitempty"` | ||||
| 	ClusterNameLabel                       string                `json:"cluster_name_label,omitempty"` | ||||
| 	NodeReadinessLabel                     map[string]string     `json:"node_readiness_label,omitempty"` | ||||
| 	CustomPodAnnotations                   map[string]string     `json:"custom_pod_annotations,omitempty"` | ||||
|  | @ -73,7 +74,6 @@ type KubernetesMetaConfiguration struct { | |||
| 	EnablePodAntiAffinity      bool                `json:"enable_pod_antiaffinity,omitempty"` | ||||
| 	PodAntiAffinityTopologyKey string              `json:"pod_antiaffinity_topology_key,omitempty"` | ||||
| 	PodManagementPolicy        string              `json:"pod_management_policy,omitempty"` | ||||
| 	DownscalerAnnotations      []string            `json:"downscaler_annotations,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // PostgresPodResourcesDefaults defines the spec of default resources
 | ||||
|  | @ -210,7 +210,6 @@ type OperatorConfigurationData struct { | |||
| 	Scalyr                     ScalyrConfiguration                `json:"scalyr"` | ||||
| 	LogicalBackup              OperatorLogicalBackupConfiguration `json:"logical_backup"` | ||||
| 	ConnectionPooler           ConnectionPoolerConfiguration      `json:"connection_pooler"` | ||||
| 	DownscalerAnnotations      []string                           `json:"downscaler_annotations,omitempty"` | ||||
| } | ||||
| 
 | ||||
| //Duration shortens this frequently used name
 | ||||
|  |  | |||
|  | @ -180,6 +180,11 @@ func (in *KubernetesMetaConfiguration) DeepCopyInto(out *KubernetesMetaConfigura | |||
| 		*out = make([]string, len(*in)) | ||||
| 		copy(*out, *in) | ||||
| 	} | ||||
| 	if in.DownscalerAnnotations != nil { | ||||
| 		in, out := &in.DownscalerAnnotations, &out.DownscalerAnnotations | ||||
| 		*out = make([]string, len(*in)) | ||||
| 		copy(*out, *in) | ||||
| 	} | ||||
| 	if in.NodeReadinessLabel != nil { | ||||
| 		in, out := &in.NodeReadinessLabel, &out.NodeReadinessLabel | ||||
| 		*out = make(map[string]string, len(*in)) | ||||
|  | @ -202,11 +207,6 @@ func (in *KubernetesMetaConfiguration) DeepCopyInto(out *KubernetesMetaConfigura | |||
| 		} | ||||
| 	} | ||||
| 	out.PodEnvironmentConfigMap = in.PodEnvironmentConfigMap | ||||
| 	if in.DownscalerAnnotations != nil { | ||||
| 		in, out := &in.DownscalerAnnotations, &out.DownscalerAnnotations | ||||
| 		*out = make([]string, len(*in)) | ||||
| 		copy(*out, *in) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
|  | @ -343,11 +343,6 @@ func (in *OperatorConfigurationData) DeepCopyInto(out *OperatorConfigurationData | |||
| 	out.Scalyr = in.Scalyr | ||||
| 	out.LogicalBackup = in.LogicalBackup | ||||
| 	in.ConnectionPooler.DeepCopyInto(&out.ConnectionPooler) | ||||
| 	if in.DownscalerAnnotations != nil { | ||||
| 		in, out := &in.DownscalerAnnotations, &out.DownscalerAnnotations | ||||
| 		*out = make([]string, len(*in)) | ||||
| 		copy(*out, *in) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -48,8 +48,6 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur | |||
| 	result.SidecarImages = fromCRD.SidecarImages | ||||
| 	result.SidecarContainers = fromCRD.SidecarContainers | ||||
| 
 | ||||
| 	result.DownscalerAnnotations = fromCRD.Kubernetes.DownscalerAnnotations | ||||
| 
 | ||||
| 	// user config
 | ||||
| 	result.SuperUsername = fromCRD.PostgresUsersConfiguration.SuperUsername | ||||
| 	result.ReplicationUsername = fromCRD.PostgresUsersConfiguration.ReplicationUsername | ||||
|  | @ -75,6 +73,7 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur | |||
| 	result.PodRoleLabel = fromCRD.Kubernetes.PodRoleLabel | ||||
| 	result.ClusterLabels = fromCRD.Kubernetes.ClusterLabels | ||||
| 	result.InheritedLabels = fromCRD.Kubernetes.InheritedLabels | ||||
| 	result.DownscalerAnnotations = fromCRD.Kubernetes.DownscalerAnnotations | ||||
| 	result.ClusterNameLabel = fromCRD.Kubernetes.ClusterNameLabel | ||||
| 	result.NodeReadinessLabel = fromCRD.Kubernetes.NodeReadinessLabel | ||||
| 	result.PodPriorityClassName = fromCRD.Kubernetes.PodPriorityClassName | ||||
|  |  | |||
|  | @ -34,6 +34,7 @@ type Resources struct { | |||
| 	SpiloPrivileged         bool                `name:"spilo_privileged" default:"false"` | ||||
| 	ClusterLabels           map[string]string   `name:"cluster_labels" default:"application:spilo"` | ||||
| 	InheritedLabels         []string            `name:"inherited_labels" default:""` | ||||
| 	DownscalerAnnotations   []string            `name:"downscaler_annotations"` | ||||
| 	ClusterNameLabel        string              `name:"cluster_name_label" default:"cluster-name"` | ||||
| 	PodRoleLabel            string              `name:"pod_role_label" default:"spilo-role"` | ||||
| 	PodToleration           map[string]string   `name:"toleration" default:""` | ||||
|  | @ -137,7 +138,6 @@ type Config struct { | |||
| 	EnableReplicaLoadBalancer              bool              `name:"enable_replica_load_balancer" default:"false"` | ||||
| 	CustomServiceAnnotations               map[string]string `name:"custom_service_annotations"` | ||||
| 	CustomPodAnnotations                   map[string]string `name:"custom_pod_annotations"` | ||||
| 	DownscalerAnnotations                  []string          `name:"downscaler_annotations"` | ||||
| 	EnablePodAntiAffinity                  bool              `name:"enable_pod_antiaffinity" default:"false"` | ||||
| 	PodAntiAffinityTopologyKey             string            `name:"pod_antiaffinity_topology_key" default:"kubernetes.io/hostname"` | ||||
| 	// deprecated and kept for backward compatibility
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue