diff --git a/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml b/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml index 8d480e0ac2..bf189159ad 100644 --- a/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml +++ b/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml @@ -157,7 +157,7 @@ spec: - name: PGHOST value: pg-r - name: RETENTION_DAYS - value: \\"60\\" + value: \\"7\\" affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: @@ -379,7 +379,7 @@ spec: size: 8Gi storageClass: csi-cinder-high-speed backup: - retentionPolicy: 60d + retentionPolicy: 7d barmanObjectStore: data: compression: gzip diff --git a/packages/kontinuous/tests/__snapshots__/pg.preprod.yaml b/packages/kontinuous/tests/__snapshots__/pg.preprod.yaml new file mode 100644 index 0000000000..15a1112ae2 --- /dev/null +++ b/packages/kontinuous/tests/__snapshots__/pg.preprod.yaml @@ -0,0 +1,644 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test build manifests with snapshots pg.preprod 1`] = ` +"apiVersion: v1 +kind: Namespace +metadata: + annotations: + field.cattle.io/projectId: \\"1234\\" + kontinuous/gitBranch: feature-branch-1 + kontinuous/mainNamespace: \\"true\\" + kapp.k14s.io/exists: \\"\\" + kontinuous/chartPath: project.fabrique.contrib.rancher-namespace + kontinuous/source: project/charts/fabrique/charts/contrib/charts/rancher-namespace/templates/namespace.yaml + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + labels: + application: test-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: namespace-test-pg-preprod-17ujfkwo + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + cert: wildcard + name: test-pg-preprod +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: netpol-ingress + namespace: test-pg-preprod + annotations: + kontinuous/chartPath: project.fabrique.contrib.security-policies + kontinuous/source: project/charts/fabrique/charts/contrib/charts/security-policies/templates/network-policy.yml + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + labels: + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: networkpolicy-netpol-ingress-61ndxljw + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous +spec: + ingress: + - from: + - podSelector: {} + - from: + - namespaceSelector: + matchLabels: + network-policy/source: ingress-controller + - from: + - namespaceSelector: + matchLabels: + network-policy/source: monitoring + podSelector: {} + policyTypes: + - Ingress +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: default + annotations: + kontinuous/chartPath: project.fabrique.contrib.security-policies + kontinuous/source: project/charts/fabrique/charts/contrib/charts/security-policies/templates/service-account.yaml + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + labels: + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: serviceaccount-default-2g5dmk74 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + namespace: test-pg-preprod +automountServiceAccountToken: false +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + labels: + app: cnpg-backup-s3-client + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: cronjob-cnpg-backup-cron-46qlv71y + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: cnpg-backup-cron + annotations: + kontinuous/chartPath: project.fabrique.cnpg.cnpg-cluster + kontinuous/source: project/charts/fabrique/charts/cnpg/charts/cnpg-cluster/templates/backup-cron.yaml + kontinuous/plugin.needs: | + - project.fabrique.cnpg.jobs-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + namespace: test-pg-preprod +spec: + schedule: 0 0 * * * + concurrencyPolicy: Forbid + jobTemplate: + spec: + backoffLimit: 0 + template: + metadata: + labels: + app: cnpg-backup-s3-client + name: backup-cron + spec: + securityContext: + runAsUser: 1001 + runAsGroup: 1001 + fsGroup: 1001 + restartPolicy: Never + containers: + - name: s3-client + image: ghcr.io/socialgouv/docker/s3-client:1.2.0 + imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: false + env: + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: fabrique-dev-backups-access-key + key: bucket_access_key + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: fabrique-dev-backups-access-key + key: bucket_secret_key + - name: AWS_DEFAULT_REGION + valueFrom: + secretKeyRef: + name: fabrique-dev-backups-access-key + key: bucket_region + - name: AWS_ENDPOINT_URL + value: https://s3.gra.io.cloud.ovh.net + - name: DESTINATION_PATH + value: s3://fabrique-dev-backups/test-pg-preprod/cnpg/dumps + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: cnpg-superuser + key: password + - name: PGUSER + valueFrom: + secretKeyRef: + name: cnpg-superuser + key: username + - name: PGDATABASE + value: preprod + - name: PGHOST + value: cnpg-r + - name: RETENTION_DAYS + value: \\"7\\" + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + preference: + matchExpressions: + - key: nodepool + operator: In + values: + - prod-build + tolerations: + - key: pool + operator: Equal + value: ci + effect: NoSchedule +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: job-preprod-test-pg-feature-branch-1-create-secrets-c-23y0idio + namespace: test-pg-preprod + annotations: + kontinuous/needsName: create-secrets.create-secrets + kontinuous/needsNames: '[\\"create-secrets\\",\\"create-secrets.create-secrets\\",\\"create-secrets..create-secrets\\"]' + kontinuous/chartPath: project.fabrique.cnpg.jobs-pg + kontinuous/source: project/charts/fabrique/charts/cnpg/charts/jobs-pg/templates/jobs.yaml + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/depname.full: project.fabrique.cnpg.jobs-pg.job.job-preprod-test-pg-feature-branch-1-create-secrets-c-23y0idio + kontinuous/depname.chartResource: jobs-pg.job.job-preprod-test-pg-feature-branch-1-create-secrets-c-23y0idio + kontinuous/depname.chartName: jobs-pg + kontinuous/depname.chartPath: project.fabrique.cnpg.jobs-pg + kontinuous/depname.resourcePath: job.job-preprod-test-pg-feature-branch-1-create-secrets-c-23y0idio + kontinuous/depname.resourceName: job-preprod-test-pg-feature-branch-1-create-secrets-c-23y0idio + kontinuous/depname.chartNameTopFull: cnpg.jobs-pg + kontinuous/depname.chartNameTop: cnpg + kontinuous/plugin.log: \\"true\\" + labels: + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: job-job-preprod-test-pg-feature-branch-1-create-secre-2fexbo2w + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous +spec: + backoffLimit: 6 + activeDeadlineSeconds: 3600 + ttlSecondsAfterFinished: 1800 + template: + metadata: + labels: + environment: preprod + ref: feature-branch-1 + repository: test-pg + runName: cnpg-create-secrets + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: job-job-preprod-test-pg-feature-branch-1-create-secre-2fexbo2w + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + spec: + restartPolicy: Never + initContainers: + - name: degit-action + image: ghcr.io/socialgouv/kontinuous/degit:v1.180.1 + command: + - sh + - -c + - degit --disable-cache + socialgouv/kontinuous/plugins/contrib/jobs/cnpg-create-secrets + /action + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + volumeMounts: + - name: action + mountPath: /action + resources: + limits: {} + requests: {} + containers: + - name: job + image: bitnami/kubectl:latest + imagePullPolicy: IfNotPresent + env: + - name: APP_DB_SECRET_NAME + value: cnpg-app + - name: CNPG_DB_SECRET_NAME + value: cnpg-db + - name: HBA_DATABASE + value: \\"*\\" + - name: HBA_HOST + value: cnpg-rw + - name: HBA_USER + value: \\"*\\" + - name: NAMESPACE + value: test-pg-preprod + - name: PGDATABASE + value: preprod + - name: PGHOST + value: cnpg-rw + - name: PGPORT + value: \\"5432\\" + - name: PGUSER + value: preprod + - name: KUBECONFIG + value: /secrets/k8s/kubeconfig + - name: KONTINUOUS_OUTPUT + value: /kontinuous-output + - name: KONTINUOUS_INPUT + value: /kontinuous-input + command: + - /bin/bash + - -c + - | + set -e + /action/create-secrets.sh + resources: + limits: {} + requests: {} + securityContext: + runAsUser: 1001 + runAsGroup: 1001 + volumeMounts: + - name: workspace + mountPath: /workspace + - name: action + mountPath: /action + - name: kubeconfig + mountPath: /secrets/k8s + readOnly: true + - name: kontinuous-io + mountPath: /kontinuous-output + subPath: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3/jobs-pg.create-secrets.create-secrets + securityContext: + fsGroup: 1001 + volumes: + - name: workspace + emptyDir: {} + - name: action + emptyDir: {} + - name: kubeconfig + secret: + secretName: kubeconfig + items: + - key: KUBECONFIG + path: kubeconfig + - name: kontinuous-io + emptyDir: {} + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + preference: + matchExpressions: + - key: nodepool + operator: In + values: + - prod-build + tolerations: + - key: pool + operator: Equal + value: ci + effect: NoSchedule +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + component: hasura + application: test-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: deployment-hasura-3fivxu5u + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: hasura + namespace: test-pg-preprod + annotations: + kontinuous/chartPath: project.fabrique.contrib.hasura + kontinuous/source: project/charts/fabrique/charts/contrib/charts/hasura/templates/deployment.yaml + kontinuous/plugin.needs: '[\\"cnpg\\"]' + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/depname.full: project.fabrique.contrib.hasura.deployment.hasura + kontinuous/depname.chartResource: hasura.deployment.hasura + kontinuous/depname.chartName: hasura + kontinuous/depname.chartPath: project.fabrique.contrib.hasura + kontinuous/depname.resourcePath: deployment.hasura + kontinuous/depname.resourceName: hasura + kontinuous/depname.chartNameTopFull: hasura + kontinuous/depname.chartNameTop: hasura + kontinuous/plugin.log: \\"false\\" + reloader.stakater.com/auto: \\"true\\" +spec: + replicas: 1 + selector: + matchLabels: + component: hasura + template: + metadata: + labels: + component: hasura + application: test-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: deployment-hasura-3fivxu5u + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + spec: + containers: + - image: harbor.fabrique.social.gouv.fr/fabrique/test-pg/hasura:preprod-ffac537e6cbbf934b08745a378932722df287a53 + name: hasura + ports: + - containerPort: 8080 + name: http + resources: + limits: {} + requests: {} + livenessProbe: + httpGet: + path: /healthz + port: http + failureThreshold: 15 + initialDelaySeconds: 30 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + exec: + command: + - cat + - /var/run/readiness-check/readiness-file + initialDelaySeconds: 5 + periodSeconds: 5 + startupProbe: + httpGet: + path: /healthz + port: http + failureThreshold: 60 + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + env: + - name: HASURA_GRAPHQL_MIGRATIONS_SERVER_TIMEOUT + value: \\"360\\" + envFrom: + - secretRef: + name: cnpg-app + lifecycle: + postStart: + exec: + command: + - sh + - -c + - touch /var/run/readiness-check/readiness-file + preStop: + exec: + command: + - sh + - -c + - rm -f /var/run/readiness-check/readiness-file; sleep 30 + volumeMounts: + - name: readiness-check-volume + mountPath: /var/run/readiness-check + volumes: + - name: readiness-check-volume + emptyDir: {} +--- +apiVersion: v1 +kind: Service +metadata: + labels: + component: hasura + application: test-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: service-hasura-2b56e0cf + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: hasura + namespace: test-pg-preprod + annotations: + kontinuous/chartPath: project.fabrique.contrib.hasura + kontinuous/source: project/charts/fabrique/charts/contrib/charts/hasura/templates/service.yaml + kontinuous/plugin.needs: '[\\"cnpg\\"]' + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 +spec: + ports: + - name: http + port: 80 + targetPort: 8080 + selector: + component: hasura + type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + kontinuous/chartPath: project.fabrique.contrib.hasura + kontinuous/source: project/charts/fabrique/charts/contrib/charts/hasura/templates/ingress.yaml + kontinuous/plugin.needs: '[\\"cnpg\\"]' + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + labels: + component: hasura + application: test-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: ingress-hasura-2784v1wj + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: hasura + namespace: test-pg-preprod +spec: + rules: + - host: hasura-test-pg-preprod.ovh.fabrique.social.gouv.fr + http: + paths: + - backend: + service: + name: hasura + port: + name: http + path: / + pathType: Prefix + tls: + - hosts: + - hasura-test-pg-preprod.ovh.fabrique.social.gouv.fr + secretName: wildcard-crt +--- +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: cnpg + labels: + helm.sh/chart: cnpg-cluster-1.15.1 + app.kubernetes.io/name: cnpg + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: \\"15\\" + app.kubernetes.io/managed-by: Helm + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: cluster-cnpg-ojdq2mqf + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + app.kubernetes.io/managed-by: Helm + kontinuous/chartPath: project.fabrique.cnpg.cnpg-cluster + kontinuous/source: project/charts/fabrique/charts/cnpg/charts/cnpg-cluster/templates/cluster.cnpg.yaml + kontinuous/plugin.needs: | + - project.fabrique.cnpg.jobs-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/depname.full: project.fabrique.cnpg.cnpg-cluster.cluster.cnpg + kontinuous/depname.chartResource: cnpg-cluster.cluster.cnpg + kontinuous/depname.chartName: cnpg-cluster + kontinuous/depname.chartPath: project.fabrique.cnpg.cnpg-cluster + kontinuous/depname.resourcePath: cluster.cnpg + kontinuous/depname.resourceName: cnpg + kontinuous/depname.chartNameTopFull: cnpg.cnpg-cluster + kontinuous/depname.chartNameTop: cnpg + kontinuous/plugin.log: \\"false\\" + namespace: test-pg-preprod +spec: + instances: 1 + imageName: ghcr.io/cloudnative-pg/postgis:14 + imagePullPolicy: IfNotPresent + resources: + limits: + cpu: 4 + memory: 1G + requests: + cpu: 100m + memory: 42Mb + storage: + size: 8Gi + storageClass: csi-cinder-high-speed + backup: + retentionPolicy: 7d + barmanObjectStore: + data: + compression: gzip + destinationPath: s3://fabrique-dev-backups/test-pg-preprod + endpointURL: https://s3.gra.io.cloud.ovh.net + s3Credentials: + accessKeyId: + key: bucket_access_key + name: fabrique-dev-backups-access-key + region: + key: bucket_region + name: fabrique-dev-backups-access-key + secretAccessKey: + key: bucket_secret_key + name: fabrique-dev-backups-access-key + wal: + compression: gzip + minSyncReplicas: 0 + maxSyncReplicas: 0 + postgresql: + parameters: + TimeZone: Europe/Paris + max_standby_archive_delay: 1d + max_standby_streaming_delay: 1d + pg_stat_statements.max: \\"10000\\" + pg_stat_statements.track: all + monitoring: + enablePodMonitor: true + priorityClassName: cnpg-high-priority-3 + bootstrap: + initdb: + database: preprod + owner: preprod + secret: + name: cnpg-db + postInitTemplateSQL: + - CREATE EXTENSION IF NOT EXISTS \\"postgis\\"; + - CREATE EXTENSION IF NOT EXISTS \\"postgis_topology\\"; + - CREATE EXTENSION IF NOT EXISTS \\"fuzzystrmatch\\"; + - CREATE EXTENSION IF NOT EXISTS \\"postgis_tiger_geocoder\\"; + - CREATE EXTENSION IF NOT EXISTS \\"uuid-ossp\\"; + - CREATE EXTENSION IF NOT EXISTS \\"citext\\"; + - CREATE EXTENSION IF NOT EXISTS \\"pgcrypto\\"; + - CREATE EXTENSION IF NOT EXISTS \\"hstore\\"; + enablePDB: false + enableSuperuserAccess: true +--- +apiVersion: postgresql.cnpg.io/v1 +kind: ScheduledBackup +metadata: + name: cnpg-scheduledbackup + labels: + helm.sh/chart: cnpg-cluster-1.15.1 + app.kubernetes.io/name: cnpg + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: \\"15\\" + app.kubernetes.io/managed-by: Helm + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + kontinuous/deployment.env: test-pg-preprod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: scheduledbackup-cnpg-scheduledbackup-28p98xvy + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + kontinuous/chartPath: project.fabrique.cnpg.cnpg-cluster + kontinuous/source: project/charts/fabrique/charts/cnpg/charts/cnpg-cluster/templates/scheduledbackup.cnpg.yaml + kontinuous/plugin.needs: | + - project.fabrique.cnpg.jobs-pg + kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 + namespace: test-pg-preprod +spec: + backupOwnerReference: self + cluster: + name: cnpg + schedule: 0 0 0 * * * + immediate: true +" +`; diff --git a/packages/kontinuous/tests/samples/pg/env/preprod/values.yaml b/packages/kontinuous/tests/samples/pg/env/preprod/values.yaml new file mode 100644 index 0000000000..77ebc6577e --- /dev/null +++ b/packages/kontinuous/tests/samples/pg/env/preprod/values.yaml @@ -0,0 +1 @@ +# hi diff --git a/plugins/fabrique/charts/pg/values.yaml b/plugins/fabrique/charts/pg/values.yaml index c0f3218ef5..50f1730f35 100644 --- a/plugins/fabrique/charts/pg/values.yaml +++ b/plugins/fabrique/charts/pg/values.yaml @@ -56,8 +56,8 @@ cnpg-cluster: backup: ~tpl~enabled: "{{ (or .Values.Parent.backup.enabled .Values.global.isProd .Values.global.isPreProd) | ternary `true` `false` }}" schedule: "0 0 0 * * *" # daily - retentionPolicy: 60d - sqlDumpRetentionDays: "60" + ~tpl~retentionPolicy: "{{ .Values.global.isProd | ternary `60d` `7d` }}" + ~tpl~sqlDumpRetentionDays: "{{ .Values.global.isProd | ternary `'60'` `'7'` }}" barmanObjectStore: ~tpl~destinationPath: "s3://{{ .Values.global.projectName }}-{{ .Values.global.isProd | ternary `prod` `dev` }}-backups/{{ .Values.global.namespace }}{{ (ne .Values.Parent.backup.name ``) | ternary (print `-` .Values.Parent.backup.name) `` }}" ~tpl~endpointURL: "{{ .Values.global.pgBackupEndpointURL }}"