diff --git a/packages/kontinuous/tests/__snapshots__/extends-ovh.dev.yaml b/packages/kontinuous/tests/__snapshots__/extends-ovh.dev.yaml index 4f5f5d924f..989cb77780 100644 --- a/packages/kontinuous/tests/__snapshots__/extends-ovh.dev.yaml +++ b/packages/kontinuous/tests/__snapshots__/extends-ovh.dev.yaml @@ -557,7 +557,7 @@ kind: Cluster metadata: name: pg-hasura labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg-hasura app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -591,6 +591,11 @@ spec: instances: 1 imageName: ghcr.io/cloudnative-pg/postgis:14 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 1Gb + requests: + memory: 128Mb storage: size: 8Gi storageClass: csi-cinder-high-speed @@ -603,6 +608,7 @@ spec: pg_stat_statements.track: all monitoring: enablePodMonitor: false + priorityClassName: cnpg-high-priority bootstrap: initdb: database: autodevops_feature-branch-1 @@ -624,7 +630,7 @@ kind: Cluster metadata: name: pg-keycloak labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg-keycloak app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -658,6 +664,11 @@ spec: instances: 1 imageName: ghcr.io/cloudnative-pg/postgis:14 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 1Gb + requests: + memory: 128Mb storage: size: 8Gi storageClass: csi-cinder-high-speed @@ -670,6 +681,7 @@ spec: pg_stat_statements.track: all monitoring: enablePodMonitor: false + priorityClassName: cnpg-high-priority bootstrap: initdb: database: autodevops_feature-branch-1 diff --git a/packages/kontinuous/tests/__snapshots__/extends-ovh.prod.yaml b/packages/kontinuous/tests/__snapshots__/extends-ovh.prod.yaml index cfcc07c2d7..83540e44c6 100644 --- a/packages/kontinuous/tests/__snapshots__/extends-ovh.prod.yaml +++ b/packages/kontinuous/tests/__snapshots__/extends-ovh.prod.yaml @@ -100,7 +100,7 @@ metadata: kontinuous/deployment: test-extends-ovh-feature-branch-1-ffac537e6cbbf934b08-5oa7s3iv namespace: test-extends-ovh spec: - schedule: 0 0 * * 0 + schedule: 0 0 * * * concurrencyPolicy: Forbid jobTemplate: spec: @@ -118,7 +118,7 @@ spec: restartPolicy: Never containers: - name: s3-client - image: ghcr.io/socialgouv/docker/s3-client:1 + image: ghcr.io/socialgouv/docker/s3-client:1.2.0 imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false @@ -156,6 +156,8 @@ spec: value: test-extends-ovh - name: PGHOST value: pg-hasura-r + - name: RETENTION_DAYS + value: 30 --- apiVersion: batch/v1 kind: CronJob @@ -179,7 +181,7 @@ metadata: kontinuous/deployment: test-extends-ovh-feature-branch-1-ffac537e6cbbf934b08-5oa7s3iv namespace: test-extends-ovh spec: - schedule: 0 0 * * 0 + schedule: 0 0 * * * concurrencyPolicy: Forbid jobTemplate: spec: @@ -197,7 +199,7 @@ spec: restartPolicy: Never containers: - name: s3-client - image: ghcr.io/socialgouv/docker/s3-client:1 + image: ghcr.io/socialgouv/docker/s3-client:1.2.0 imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false @@ -235,6 +237,8 @@ spec: value: test-extends-ovh - name: PGHOST value: pg-keycloak-r + - name: RETENTION_DAYS + value: 30 --- apiVersion: batch/v1 kind: Job @@ -716,7 +720,7 @@ kind: Cluster metadata: name: pg-hasura labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg-hasura app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -750,6 +754,11 @@ spec: instances: 3 imageName: ghcr.io/cloudnative-pg/postgis:14 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 1Gb + requests: + memory: 128Mb storage: size: 8Gi storageClass: managed-csi @@ -781,6 +790,7 @@ spec: pg_stat_statements.track: all monitoring: enablePodMonitor: true + priorityClassName: cnpg-high-priority bootstrap: initdb: database: test-extends-ovh @@ -802,7 +812,7 @@ kind: Cluster metadata: name: pg-keycloak labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg-keycloak app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -836,6 +846,11 @@ spec: instances: 3 imageName: ghcr.io/cloudnative-pg/postgis:14 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 1Gb + requests: + memory: 128Mb storage: size: 8Gi storageClass: managed-csi @@ -867,6 +882,7 @@ spec: pg_stat_statements.track: all monitoring: enablePodMonitor: true + priorityClassName: cnpg-high-priority bootstrap: initdb: database: test-extends-ovh @@ -888,7 +904,7 @@ kind: ScheduledBackup metadata: name: pg-hasura-scheduledbackup labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg-hasura app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -913,13 +929,14 @@ spec: cluster: name: pg-hasura schedule: 0 0 0 * * * + immediate: true --- apiVersion: postgresql.cnpg.io/v1 kind: ScheduledBackup metadata: name: pg-keycloak-scheduledbackup labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg-keycloak app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -944,5 +961,6 @@ spec: cluster: name: pg-keycloak schedule: 0 0 0 * * * + immediate: true " `; diff --git a/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml b/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml index 324324b094..f842cae2cf 100644 --- a/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml +++ b/packages/kontinuous/tests/__snapshots__/override-env-default.dev.yaml @@ -101,7 +101,7 @@ metadata: kontinuous/deployment: test-override-env-default-feature-branch-1-ffac537e6c-tw0tuagy namespace: test-override-env-default-feature-branch-1 spec: - schedule: 0 0 * * 0 + schedule: 0 0 * * * concurrencyPolicy: Forbid jobTemplate: spec: @@ -119,7 +119,7 @@ spec: restartPolicy: Never containers: - name: s3-client - image: ghcr.io/socialgouv/docker/s3-client:1 + image: ghcr.io/socialgouv/docker/s3-client:1.2.0 imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false @@ -157,6 +157,8 @@ spec: value: autodevops_feature-branch-1 - name: PGHOST value: pg-r + - name: RETENTION_DAYS + value: 30 --- apiVersion: batch/v1 kind: Job @@ -312,7 +314,7 @@ kind: Cluster metadata: name: pg labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -346,6 +348,11 @@ spec: instances: 1 imageName: ghcr.io/cloudnative-pg/postgis:14 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 1Gb + requests: + memory: 128Mb storage: size: 8Gi storageClass: csi-cinder-high-speed @@ -377,6 +384,7 @@ spec: pg_stat_statements.track: all monitoring: enablePodMonitor: false + priorityClassName: cnpg-high-priority bootstrap: initdb: database: autodevops_feature-branch-1 @@ -398,7 +406,7 @@ kind: ScheduledBackup metadata: name: pg-scheduledbackup labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: pg app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -423,5 +431,6 @@ spec: cluster: name: pg schedule: 0 0 0 * * * + immediate: true " `; diff --git a/packages/kontinuous/tests/__snapshots__/pg.prod.yaml b/packages/kontinuous/tests/__snapshots__/pg.prod.yaml index 71ad599ee9..856942efa4 100644 --- a/packages/kontinuous/tests/__snapshots__/pg.prod.yaml +++ b/packages/kontinuous/tests/__snapshots__/pg.prod.yaml @@ -100,7 +100,7 @@ metadata: kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3 namespace: test-pg spec: - schedule: 0 0 * * 0 + schedule: 0 0 * * * concurrencyPolicy: Forbid jobTemplate: spec: @@ -118,7 +118,7 @@ spec: restartPolicy: Never containers: - name: s3-client - image: ghcr.io/socialgouv/docker/s3-client:1 + image: ghcr.io/socialgouv/docker/s3-client:1.2.0 imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false @@ -156,6 +156,8 @@ spec: value: test-pg - name: PGHOST value: cnpg-r + - name: RETENTION_DAYS + value: 30 --- apiVersion: batch/v1 kind: Job @@ -476,7 +478,7 @@ kind: Cluster metadata: name: cnpg labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: cnpg app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -510,6 +512,11 @@ spec: instances: 3 imageName: ghcr.io/cloudnative-pg/postgis:14 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 1Gb + requests: + memory: 42Mb storage: size: 8Gi storageClass: managed-csi @@ -541,6 +548,7 @@ spec: pg_stat_statements.track: all monitoring: enablePodMonitor: true + priorityClassName: cnpg-high-priority bootstrap: initdb: database: test-pg @@ -562,7 +570,7 @@ kind: ScheduledBackup metadata: name: cnpg-scheduledbackup labels: - helm.sh/chart: cnpg-cluster-1.9.12 + helm.sh/chart: cnpg-cluster-1.15.0 app.kubernetes.io/name: cnpg app.kubernetes.io/instance: release-name app.kubernetes.io/version: \\"15\\" @@ -587,5 +595,6 @@ spec: cluster: name: cnpg schedule: 0 0 0 * * * + immediate: true " `; diff --git a/packages/kontinuous/tests/samples/extends-ovh/config.yaml b/packages/kontinuous/tests/samples/extends-ovh/config.yaml index 2ae0db011e..8ad636346d 100644 --- a/packages/kontinuous/tests/samples/extends-ovh/config.yaml +++ b/packages/kontinuous/tests/samples/extends-ovh/config.yaml @@ -10,4 +10,4 @@ dependencies: # links: # socialgouv/helm-charts/charts/cnpg-cluster@v1: ./charts-overrides/cnpg-cluster remoteLinks: - socialgouv/helm-charts/charts/cnpg-cluster@v1: socialgouv/helm-charts/charts/cnpg-cluster@v1.9.12 + socialgouv/helm-charts/charts/cnpg-cluster@v1: socialgouv/helm-charts/charts/cnpg-cluster@v1.15.0 diff --git a/packages/kontinuous/tests/samples/override-env-default/config.yaml b/packages/kontinuous/tests/samples/override-env-default/config.yaml index 82b4d56a57..017f82491e 100644 --- a/packages/kontinuous/tests/samples/override-env-default/config.yaml +++ b/packages/kontinuous/tests/samples/override-env-default/config.yaml @@ -8,4 +8,4 @@ dependencies: ifEnv: [dev] remoteLinks: - socialgouv/helm-charts/charts/cnpg-cluster@v1: socialgouv/helm-charts/charts/cnpg-cluster@v1.9.12 + socialgouv/helm-charts/charts/cnpg-cluster@v1: socialgouv/helm-charts/charts/cnpg-cluster@v1.15.0 diff --git a/packages/kontinuous/tests/samples/pg/config.yaml b/packages/kontinuous/tests/samples/pg/config.yaml index 710cdb2351..d7b0e5e0c9 100644 --- a/packages/kontinuous/tests/samples/pg/config.yaml +++ b/packages/kontinuous/tests/samples/pg/config.yaml @@ -5,4 +5,4 @@ dependencies: import: socialgouv/kontinuous/plugins/fabrique remoteLinks: - socialgouv/helm-charts/charts/cnpg-cluster@v1: socialgouv/helm-charts/charts/cnpg-cluster@v1.9.12 + socialgouv/helm-charts/charts/cnpg-cluster@v1: socialgouv/helm-charts/charts/cnpg-cluster@v1.15.0 diff --git a/packages/kontinuous/tests/samples/pg/values.yaml b/packages/kontinuous/tests/samples/pg/values.yaml index 77e1c553e1..c99557b161 100644 --- a/packages/kontinuous/tests/samples/pg/values.yaml +++ b/packages/kontinuous/tests/samples/pg/values.yaml @@ -6,3 +6,7 @@ hasura: cnpg: ~chart: pg + cnpg-cluster: + resources: + requests: + memory: 42Mb diff --git a/plugins/fabrique/charts/pg/values.yaml b/plugins/fabrique/charts/pg/values.yaml index bd6507aa4d..b38e3427f7 100644 --- a/plugins/fabrique/charts/pg/values.yaml +++ b/plugins/fabrique/charts/pg/values.yaml @@ -42,6 +42,13 @@ cnpg-cluster: image: repository: "ghcr.io/cloudnative-pg/postgis" tag: "14" + + resources: + requests: + ~tpl~memory: "{{ or (and .Values.Parent._ProjectValues (index .Values.Parent._ProjectValues `cnpg-cluster`).resources (index .Values.Parent._ProjectValues `cnpg-cluster`).resources.requests (index .Values.Parent._ProjectValues `cnpg-cluster`).resources.requests.memory) `128Mb` }}" + limits: + ~tpl~memory: "{{ or (and .Values.Parent._ProjectValues (index .Values.Parent._ProjectValues `cnpg-cluster`).resources (index .Values.Parent._ProjectValues `cnpg-cluster`).resources.limits (index .Values.Parent._ProjectValues `cnpg-cluster`).resources.limits.memory) `1Gb` }}" + backup: ~tpl~enabled: "{{ (or .Values.Parent.backup.enabled .Values.global.isProd .Values.global.isPreProd) | ternary `true` `false` }}" schedule: "0 0 0 * * *" # daily