helmfile.yaml 2.64 KB
bases:
  - ../common/environments.yaml

repositories:
  - name: postgres-operator-charts
    url: https://opensource.zalando.com/postgres-operator/charts/postgres-operator

---

releases:
  - name: postgres-extra-config
    namespace: {{ .Values.namespace }}
    chart: charts/extra-config
    strategicMergePatches:
      - apiVersion: v1
        kind: ConfigMap
        metadata:
          name: postgres-extra-config
          namespace: {{ .Values.namespace }}
        data:
          BACKUP_SCHEDULE: {{ .Values.backup.schedule | quote }}
          BACKUP_NUM_TO_RETAIN: {{ .Values.backup.num_to_retain | quote }}

          AWS_ENDPOINT: {{ .Values.backup.s3.endpoint }}
          AWS_ACCESS_KEY_ID: {{ .Values.backup.s3.access_key_id }}
          AWS_SECRET_ACCESS_KEY: {{ .Values.backup.s3.secret_access_key }}
          AWS_REGION: {{ .Values.backup.s3.region }}
          AWS_S3_FORCE_PATH_STYLE: {{ .Values.backup.s3.force_path_style | quote }}

          USE_WALG_BACKUP: "true"
          USE_WALG_RESTORE: "true"
          WAL_S3_BUCKET: {{ .Values.backup.s3.bucket }}
          WALG_DISABLE_S3_SSE: {{ .Values.backup.walg.disable_sse | quote }}

          CLONE_METHOD: CLONE_WITH_WALG
          CLONE_AWS_REGION: {{ .Values.backup.s3.region }}
          CLONE_AWS_ACCESS_KEY_ID: {{ .Values.backup.s3.access_key_id }}
          CLONE_AWS_SECRET_ACCESS_KEY: {{ .Values.backup.s3.secret_access_key }}
          CLONE_AWS_S3_FORCE_PATH_STYLE: {{ .Values.backup.s3.force_path_style | quote }}

  - name: postgres-operator
    namespace: {{ .Values.namespace }}
    chart: postgres-operator-charts/postgres-operator
    disableValidation: true
    values:
      - configLogicalBackup:
          logical_backup_provider: {{ .Values.backup.logical.provider }}
          logical_backup_s3_endpoint: {{ .Values.backup | get "logical.s3.endpoint" ( .Values.backup | get "s3.endpoint" "" ) }}
          logical_backup_s3_access_key_id: {{ .Values.backup | get "logical.s3.access_key_id" .Values.backup.s3.access_key_id }}
          logical_backup_s3_secret_access_key: {{ .Values.backup | get "logical.s3.secret_access_key" .Values.backup.s3.secret_access_key }}
          logical_backup_s3_bucket: {{ .Values.backup | get "logical.s3.bucket" .Values.backup.s3.bucket }}
          logical_backup_s3_region: {{ .Values.backup | get "logical.s3.region" ( .Values.backup | get "s3.region" "" ) }}
          logical_backup_s3_sse: {{ .Values.backup | get "logical.s3.sse" ( .Values.backup | get "s3.sse" "" ) }}
        configAwsOrGcp:
          wal_s3_bucket: {{ .Values.backup.s3.bucket }}
        configKubernetes:
          pod_environment_configmap: {{ .Values.namespace }}/postgres-extra-config