try to support both config styles

This commit is contained in:
Felix Kunde 2019-05-15 12:07:06 +02:00
parent ea9ec6454f
commit 8af2e6b350
4 changed files with 67 additions and 32 deletions

View File

@ -9,13 +9,18 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
data: data:
pod_service_account_name: {{ template "postgres-operator.fullname" . }} pod_service_account_name: {{ template "postgres-operator.fullname" . }}
{{ toYaml .Values.config | indent 2 }} docker_image: {{ toYaml .Values.docker_image }}
debug_logging: "{{ toYaml .Values.configDebug.debug_logging }}"
enable_database_access: "{{ toYaml .Values.configDebug.enable_database_access }}"
repair_period: {{ toYaml .Values.repair_period }}
resync_period: {{ toYaml .Values.resync_period }}
spilo_privileged: "{{ toYaml .Values.spilo_privileged }}"
{{ toYaml .Values.configMap | indent 2 }}
{{ toYaml .Values.configUsers | indent 2 }} {{ toYaml .Values.configUsers | indent 2 }}
{{ toYaml .Values.configKubernetes | indent 2 }} {{ toYaml .Values.configKubernetes | indent 2 }}
{{ toYaml .Values.configNamespace | indent 2 }} {{ toYaml .Values.configNamespace | indent 2 }}
{{ toYaml .Values.configTimeouts | indent 2 }} {{ toYaml .Values.configTimeouts | indent 2 }}
{{ toYaml .Values.configLoadBalancer | indent 2 }} {{ toYaml .Values.configLoadBalancer | indent 2 }}
{{ toYaml .Values.configAwsOrGcp | indent 2 }} {{ toYaml .Values.configAwsOrGcp | indent 2 }}
{{ toYaml .Values.configDebug | indent 2 }}
{{ toYaml .Values.configTeamsApi | indent 2 }} {{ toYaml .Values.configTeamsApi | indent 2 }}
{{ toYaml .Values.configLoggingRestApi | indent 2 }} {{ toYaml .Values.configLoggingRestApi | indent 2 }}

View File

@ -18,7 +18,7 @@ spec:
annotations: annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
# In order to use the checksum of CRD OperatorConfiguration instead, use the following line instead # In order to use the checksum of CRD OperatorConfiguration instead, use the following line instead
# checksum/config: {{ include (print $.Template.BasePath "/operatorconfiguration.yaml") . | sha256sum }} # {{ include (print $.Template.BasePath "/operatorconfiguration.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }} {{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }} {{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }} {{- end }}

View File

@ -9,18 +9,22 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
configuration: configuration:
pod_service_account_name: operator pod_service_account_name: operator
{{ toYaml .Values.config | indent 2 }} docker_image: {{ toYaml .Values.docker_image }}
repair_period: {{ toYaml .Values.repair_period }}
resync_period: {{ toYaml .Values.resync_period }}
{{ toYaml .Values.configCRD | indent 2 }} {{ toYaml .Values.configCRD | indent 2 }}
users: users:
{{ toYaml .Values.configUsers | indent 4 }} {{ toYaml .Values.configUsers | indent 4 }}
kubernetes: kubernetes:
spilo_privileged: {{ toYaml .Values.spilo_privileged }}
{{ toYaml .Values.configKubernetes | indent 4 }} {{ toYaml .Values.configKubernetes | indent 4 }}
{{ toYaml .Values.configKubernetesCRD | indent 4 }}
postgres_pod_resources: postgres_pod_resources:
{{ toYaml .Values.configPostgresPodResources | indent 4 }} {{ toYaml .Values.configPostgresPodResources | indent 4 }}
timeouts: timeouts:
{{ toYaml .Values.configTimeouts | indent 4 }} {{ toYaml .Values.configTimeouts | indent 4 }}
load_balancer: load_balancer:
{{ toYaml .Values.configLoadBalancer | indent 4 }} {{ toYaml .Values.configLoadBalancerCRD | indent 4 }}
aws_or_gcp: aws_or_gcp:
{{ toYaml .Values.configAwsOrGcp | indent 4 }} {{ toYaml .Values.configAwsOrGcp | indent 4 }}
debug: debug:
@ -28,6 +32,6 @@ configuration:
teams_api: teams_api:
{{ toYaml .Values.configTeamsApiCRD | indent 4 }} {{ toYaml .Values.configTeamsApiCRD | indent 4 }}
logging_rest_api: logging_rest_api:
{{ toYaml .Values.configLoggingRestApi | indent 4 }} {{ toYaml .Values.configLoggingRestApiCRD | indent 4 }}
scalyr: scalyr:
{{ toYaml .Values.configScalyr | indent 4 }} {{ toYaml .Values.configScalyr | indent 4 }}

View File

@ -10,19 +10,23 @@ image:
# imagePullSecrets: # imagePullSecrets:
# - name: myRegistryKeySecretName # - name: myRegistryKeySecretName
docker_image: registry.opensource.zalan.do/acid/spilo-cdp-11:1.5-p70
podAnnotations: {} podAnnotations: {}
podLabels: {} podLabels: {}
repair_period: 5m
resync_period: 5m
spilo_privileged: false
config: configMap:
cluster_labels: application:spilo cluster_labels: application:spilo
cluster_name_label: version cluster_name_label: version
docker_image: registry.opensource.zalan.do/acid/spilo-cdp-11:1.5-p70
workers: "4" workers: "4"
configCRD: configCRD:
etcd_host: "" etcd_host: ""
min_instances: -1 min_instances: -1
max_instances: -1 max_instances: -1
workers: 4
# sidecar_docker_images # sidecar_docker_images
# example: "exampleimage:exampletag" # example: "exampleimage:exampletag"
@ -31,19 +35,27 @@ configUsers:
super_username: postgres super_username: postgres
configKubernetes: configKubernetes:
cluster_labels: application:spilo
enable_pod_antiaffinity: "false"
# inherited_labels: "" # inherited_labels: ""
# infrastructure_roles_secret_name: postgresql-infrastructure-roles # infrastructure_roles_secret_name: postgresql-infrastructure-roles
# node_readiness_label: "" # node_readiness_label: ""
# oauth_token_secret_name: postgresql-operator # oauth_token_secret_name: postgresql-operator
# pod_environment_configmap: "" # pod_environment_configmap: ""
pod_antiaffinity_topology_key: "kubernetes.io/hostname"
pod_management_policy: "ordered_ready" pod_management_policy: "ordered_ready"
pdb_name_format: "postgres-{cluster}-pdb" pdb_name_format: "postgres-{cluster}-pdb"
pod_role_label: spilo-role pod_role_label: spilo-role
pod_terminate_grace_period: 5m
secret_name_template: '{username}.{cluster}.credentials' secret_name_template: '{username}.{cluster}.credentials'
spilo_privileged: "false"
configKubernetesCRD:
cluster_labels:
application: spilo
cluster_name_label: cluster-name
enable_pod_antiaffinity: false
pod_antiaffinity_topology_key: "kubernetes.io/hostname"
secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}"
# inherited_labels:
# - application
# - app
configNamespace: configNamespace:
watched_namespace: "*" # listen to all namespaces watched_namespace: "*" # listen to all namespaces
@ -53,28 +65,38 @@ configPostgresPodResources:
default_memory_request: 100Mi default_memory_request: 100Mi
default_cpu_limit: "3" default_cpu_limit: "3"
default_memory_limit: 1Gi default_memory_limit: 1Gi
# set_memory_request_to_limit: "true" # set_memory_request_to_limit: true
configTimeouts: configTimeouts:
# master_pod_move_timeout: 10m # master_pod_move_timeout: 10m
pod_deletion_wait_timeout: 10m pod_deletion_wait_timeout: 10m
pod_label_wait_timeout: 10m pod_label_wait_timeout: 10m
pod_terminate_grace_period: 5m
ready_wait_interval: 3s ready_wait_interval: 3s
ready_wait_timeout: 30s ready_wait_timeout: 30s
resync_period: 5m
repair_period: 5m
resource_check_interval: 3s resource_check_interval: 3s
resource_check_timeout: 10m resource_check_timeout: 10m
configLoadBalancer: configLoadBalancer:
# custom_service_annotations: # custom_service_annotations:
# "keyx:valuez,keya:valuea" # "keyx:valuez,keya:valuea"
enable_master_load_balancer: "false" enable_master_load_balancer: "true"
enable_replica_load_balancer: "false" enable_replica_load_balancer: "false"
master_dns_name_format: '{cluster}.{team}.staging.{hostedzone}' master_dns_name_format: '{cluster}.{team}.staging.{hostedzone}'
replica_dns_name_format: '{cluster}-repl.{team}.staging.{hostedzone}' replica_dns_name_format: '{cluster}-repl.{team}.staging.{hostedzone}'
configLoadBalancerCRD:
# custom_service_annotations:
# keyx: valuez
# keya: valuea
enable_master_load_balancer: false
enable_replica_load_balancer: false
master_dns_name_format: "{cluster}.{team}.{hostedzone}"
replica_dns_name_format: "{cluster}-repl.{team}.{hostedzone}"
configDebug:
debug_logging: true
enable_database_access: true
configAwsOrGcp: configAwsOrGcp:
aws_region: eu-central-1 aws_region: eu-central-1
db_hosted_zone: db.example.com db_hosted_zone: db.example.com
@ -82,13 +104,9 @@ configAwsOrGcp:
# log_s3_bucket: "" # log_s3_bucket: ""
# wal_s3_bucket: "" # wal_s3_bucket: ""
configDebug:
debug_logging: "true"
enable_database_access: "true"
configTeamsApi: configTeamsApi:
# enable_admin_role_for_users: "true"
enable_teams_api: "false" enable_teams_api: "false"
# enable_admin_role_for_users: "true"
# enable_team_superuser: "false" # enable_team_superuser: "false"
# pam_configuration: https://info.example.com/oauth2/tokeninfo?access_token= uid realm=/employees # pam_configuration: https://info.example.com/oauth2/tokeninfo?access_token= uid realm=/employees
# pam_role_name: zalandos # pam_role_name: zalandos
@ -98,20 +116,28 @@ configTeamsApi:
# teams_api_url: http://fake-teams-api.default.svc.cluster.local # teams_api_url: http://fake-teams-api.default.svc.cluster.local
configTeamsApiCRD: configTeamsApiCRD:
enable_team_superuser: "false" enable_teams_api: false
enable_team_superuser: false
# pam_configuration: "" # pam_configuration: ""
pam_role_name: "zalandos" pam_role_name: zalandos
# postgres_superuser_teams: "postgres_superusers" # postgres_superuser_teams: "postgres_superusers"
protected_role_names: "admin" protected_role_names:
team_admin_role: "admin" - admin
# team_api_role_configuration: "log_statement:all" team_admin_role: admin
# teams_api_url: http://fake-teams-api.default.svc.cluster.local team_api_role_configuration:
log_statement: all
# teams_api_url: ""
configLoggingRestApi: configLoggingRestApi:
api_port: "8080" api_port: "8080"
cluster_history_entries: "1000" cluster_history_entries: "1000"
ring_log_lines: "100" ring_log_lines: "100"
configLoggingRestApiCRD:
api_port: 8080
cluster_history_entries: 1000
ring_log_lines: 100
scalyr: scalyr:
scalyr_cpu_request: 100m scalyr_cpu_request: 100m
scalyr_memory_request: 50Mi scalyr_memory_request: 50Mi