Skip to content

Commit

Permalink
Fix CRD-based operator configuration (#541)
Browse files Browse the repository at this point in the history
* Fix CRD-based operator configuration

* add inherited labels, update docker image
  • Loading branch information
sdudoladov committed Apr 15, 2019
1 parent 32f1069 commit c1d108a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
7 changes: 5 additions & 2 deletions charts/postgres-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ config:

debug_logging: "true"
workers: "4"
docker_image: registry.opensource.zalan.do/acid/spilo-cdp-10:1.5-p35
docker_image: registry.opensource.zalan.do/acid/spilo-cdp-11:1.5-p70
secret_name_template: '{username}.{cluster}.credentials'
super_username: postgres
enable_teams_api: "false"
Expand All @@ -37,6 +37,7 @@ config:
# pam_role_name: zalandos
# pam_configuration: |
# https://info.example.com/oauth2/tokeninfo?access_token= uid realm=/employees
# inherited_labels: ""
aws_region: eu-central-1
db_hosted_zone: db.example.com
master_dns_name_format: '{cluster}.{team}.staging.{hostedzone}'
Expand All @@ -58,7 +59,9 @@ config:
resource_check_interval: 3s
resource_check_timeout: 10m
resync_period: 5m

pod_management_policy: "ordered_ready"
enable_pod_antiaffinity: "false"
pod_antiaffinity_topology_key: "kubernetes.io/hostname"
rbac:
# Specifies whether RBAC resources should be created
create: true
Expand Down
3 changes: 2 additions & 1 deletion manifests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data:

debug_logging: "true"
workers: "4"
docker_image: registry.opensource.zalan.do/acid/spilo-11:1.5-p4
docker_image: registry.opensource.zalan.do/acid/spilo-cdp-11:1.5-p70
pod_service_account_name: "zalando-postgres-operator"
secret_name_template: '{username}.{cluster}.credentials'
super_username: postgres
Expand All @@ -30,6 +30,7 @@ data:
# pam_role_name: zalandos
# pam_configuration: |
# https://info.example.com/oauth2/tokeninfo?access_token= uid realm=/employees
# inherited_labels: ""
aws_region: eu-central-1
db_hosted_zone: db.example.com
master_dns_name_format: '{cluster}.{team}.staging.{hostedzone}'
Expand Down
3 changes: 3 additions & 0 deletions manifests/postgresql-operator-default-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ configuration:
# toleration: {}
# infrastructure_roles_secret_name: ""
# pod_environment_configmap: ""
pod_management_policy: "ordered_ready"
enable_pod_antiaffinity: "false"
pod_antiaffinity_topology_key: "kubernetes.io/hostname"
postgres_pod_resources:
default_cpu_request: 100m
default_memory_request: 100Mi
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/acid.zalan.do/v1/operator_configuration_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ type KubernetesMetaConfiguration struct {
PodEnvironmentConfigMap string `json:"pod_environment_configmap,omitempty"`
PodPriorityClassName string `json:"pod_priority_class_name,omitempty"`
MasterPodMoveTimeout time.Duration `json:"master_pod_move_timeout,omitempty"`
EnablePodAntiAffinity bool `json:"enable_pod_antiaffinity" default:"false"`
PodAntiAffinityTopologyKey string `name:"pod_antiaffinity_topology_key" default:"kubernetes.io/hostname"`
EnablePodAntiAffinity bool `json:"enable_pod_antiaffinity,omitempty"`
PodAntiAffinityTopologyKey string `json:"pod_antiaffinity_topology_key,omitempty"`
PodManagementPolicy string `json:"pod_management_policy,omitempty"`
}

// PostgresPodResourcesDefaults defines the spec of default resources
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/operator_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur
result.ClusterNameLabel = fromCRD.Kubernetes.ClusterNameLabel
result.NodeReadinessLabel = fromCRD.Kubernetes.NodeReadinessLabel
result.PodPriorityClassName = fromCRD.Kubernetes.PodPriorityClassName
result.PodManagementPolicy = fromCRD.Kubernetes.PodManagementPolicy
result.MasterPodMoveTimeout = fromCRD.Kubernetes.MasterPodMoveTimeout

result.EnablePodAntiAffinity = fromCRD.Kubernetes.EnablePodAntiAffinity
Expand Down

0 comments on commit c1d108a

Please sign in to comment.