From 68632c5f35088bd003a76ba2ae2e6f87fc5595eb Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Tue, 26 Nov 2019 12:20:41 +0100 Subject: [PATCH] rebased with master --- charts/postgres-operator/values-crd.yaml | 6 +++-- charts/postgres-operator/values.yaml | 2 -- docs/reference/operator_parameters.md | 25 ++++++------------- docs/user.md | 6 ++--- manifests/configmap.yaml | 2 ++ .../v1/operator_configuration_type.go | 4 +-- pkg/controller/operator_config.go | 4 +-- 7 files changed, 21 insertions(+), 28 deletions(-) diff --git a/charts/postgres-operator/values-crd.yaml b/charts/postgres-operator/values-crd.yaml index b6a6b3a4c..d3a2c169c 100644 --- a/charts/postgres-operator/values-crd.yaml +++ b/charts/postgres-operator/values-crd.yaml @@ -58,10 +58,14 @@ configKubernetes: cluster_name_label: cluster-name # additional annotations to add to every database pod custom_pod_annotations: + # enables initContainers to run actions before Spilo is started + enable_init_containers: false # toggles pod anti affinity on the Postgres pods enable_pod_antiaffinity: false # toggles PDB to set to MinAvailabe 0 or 1 enable_pod_disruption_budget: true + # enables sidecar containers to run alongside Spilo in the same pod + enable_sidecars: false # name of the secret containing infrastructure roles names and passwords # infrastructure_roles_secret_name: postgresql-infrastructure-roles @@ -190,8 +194,6 @@ configLogicalBackup: logical_backup_s3_access_key_id: "" # S3 bucket to store backup results logical_backup_s3_bucket: "my-bucket-url" - # S3 server side encription to use - logical_backup_s3_sse: "AES256" # S3 endpoint url when not using AWS logical_backup_s3_endpoint: "" # S3 Secret Access Key diff --git a/charts/postgres-operator/values.yaml b/charts/postgres-operator/values.yaml index 6874f79c4..9da40f523 100644 --- a/charts/postgres-operator/values.yaml +++ b/charts/postgres-operator/values.yaml @@ -189,8 +189,6 @@ configLogicalBackup: logical_backup_s3_access_key_id: "" # S3 bucket to store backup results logical_backup_s3_bucket: "my-bucket-url" - # S3 server side encription - logical_backup_s3_sse: "AES256" # S3 endpoint url when not using AWS logical_backup_s3_endpoint: "" # S3 Secret Access Key diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 6aade105e..7f609e527 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -82,14 +82,6 @@ Those are top-level keys, containing both leaf keys and groups. your own Spilo image from the [github repository](https://github.com/zalando/spilo). -* **enable_init_containers** - global option to allow for creating init containers to run actions before - Spilo is started. Disabled by default. - -* **enable_sidecars** - global option to allow for creating sidecar containers to run alongside Spilo - on the same pod. Disabled by default. - * **sidecar_docker_images** a map of sidecar names to docker images to run with Spilo. In case of the name conflict with the definition in the cluster manifest the cluster-specific one @@ -200,6 +192,14 @@ configuration they are grouped under the `kubernetes` key. [admin docs](../administrator.md#pod-disruption-budget) for more information. Default is true. +* **enable_init_containers** + global option to allow for creating init containers to run actions before + Spilo is started. Disabled by default. + +* **enable_sidecars** + global option to allow for creating sidecar containers to run alongside Spilo + on the same pod. Disabled by default. + * **secret_name_template** a template for the name of the database user secrets generated by the operator. `{username}` is replaced with name of the secret, `{cluster}` with @@ -452,19 +452,10 @@ grouped under the `logical_backup` key. * **logical_backup_s3_endpoint** When using non-AWS S3 storage, endpoint can be set as a ENV variable. -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> ebd09880... Modified dump.sh so it knows how to handle new features. Configurable S3 SSE * **logical_backup_s3_sse** Specify server side encription that S3 storage is using. If empty string is specified, no argument will be passed to `aws s3` command. Default: "AES256". -<<<<<<< HEAD -======= ->>>>>>> 7cd05ba4... Updated documentation for logical backup endpoint, access and secret key. -======= ->>>>>>> ebd09880... Modified dump.sh so it knows how to handle new features. Configurable S3 SSE * **logical_backup_s3_access_key_id** When set, value will be in AWS_ACCESS_KEY_ID env variable. The Default is empty. diff --git a/docs/user.md b/docs/user.md index 08b81ef2a..26fc055d9 100644 --- a/docs/user.md +++ b/docs/user.md @@ -378,9 +378,9 @@ spec: `initContainers` accepts full `v1.Container` definition. -**Note**: The operator will not launch a cluster if init containers are specified -but globally disabled in the configuration. The `enable_init_containers` option -must be set to `true`. +**Note**: The operator will not launch a cluster if `initContainers` are +specified but globally disabled in the configuration. The +`enable_init_containers` option must be set to `true`. ## Increase volume size diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index 0867135d8..c26e2389d 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -22,11 +22,13 @@ data: docker_image: registry.opensource.zalan.do/acid/spilo-11:1.6-p1 # enable_admin_role_for_users: "true" # enable_database_access: "true" + enable_init_containers: "false" enable_master_load_balancer: "false" # enable_pod_antiaffinity: "false" # enable_pod_disruption_budget: "true" enable_replica_load_balancer: "false" # enable_shm_volume: "true" + enable_sidecars: "false" # enable_team_superuser: "false" enable_teams_api: "false" # etcd_host: "" diff --git a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go index 1cc69af28..a0e3e8cb2 100644 --- a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go +++ b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go @@ -49,6 +49,8 @@ type KubernetesMetaConfiguration struct { SpiloFSGroup *int64 `json:"spilo_fsgroup,omitempty"` WatchedNamespace string `json:"watched_namespace,omitempty"` PDBNameFormat config.StringTemplate `json:"pdb_name_format,omitempty"` + EnableSidecars bool `json:"enable_sidecars,omitempty"` + EnableInitContainers bool `json:"enable_init_containers,omitempty"` EnablePodDisruptionBudget *bool `json:"enable_pod_disruption_budget,omitempty"` SecretNameTemplate config.StringTemplate `json:"secret_name_template,omitempty"` ClusterDomain string `json:"cluster_domain"` @@ -160,8 +162,6 @@ type OperatorConfigurationData struct { SetMemoryRequestToLimit bool `json:"set_memory_request_to_limit,omitempty"` ShmVolume *bool `json:"enable_shm_volume,omitempty"` Sidecars map[string]string `json:"sidecar_docker_images,omitempty"` - EnableSidecars bool `json:"enable_sidecars,omitempty"` - EnableInitContainers bool `json:"enable_init_containers,omitempty"` PostgresUsersConfiguration PostgresUsersConfiguration `json:"users"` Kubernetes KubernetesMetaConfiguration `json:"kubernetes"` PostgresPodResources PostgresPodResourcesDefaults `json:"postgres_pod_resources"` diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index 583f251ed..726591a32 100644 --- a/pkg/controller/operator_config.go +++ b/pkg/controller/operator_config.go @@ -35,8 +35,6 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur result.SetMemoryRequestToLimit = fromCRD.SetMemoryRequestToLimit result.ShmVolume = fromCRD.ShmVolume result.Sidecars = fromCRD.Sidecars - result.EnableSidecars = fromCRD.EnableSidecars - result.EnableInitContainers = fromCRD.EnableInitContainers // user config result.SuperUsername = fromCRD.PostgresUsersConfiguration.SuperUsername @@ -55,6 +53,8 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur result.WatchedNamespace = fromCRD.Kubernetes.WatchedNamespace result.PDBNameFormat = fromCRD.Kubernetes.PDBNameFormat result.EnablePodDisruptionBudget = fromCRD.Kubernetes.EnablePodDisruptionBudget + result.EnableSidecars = fromCRD.Kubernetes.EnableSidecars + result.EnableInitContainers = fromCRD.Kubernetes.EnableInitContainers result.SecretNameTemplate = fromCRD.Kubernetes.SecretNameTemplate result.OAuthTokenSecretName = fromCRD.Kubernetes.OAuthTokenSecretName result.InfrastructureRolesSecretName = fromCRD.Kubernetes.InfrastructureRolesSecretName