Skip to content

Commit

Permalink
chore: update config for cnpg (#1226)
Browse files Browse the repository at this point in the history
Co-authored-by: Martial Maillot <[email protected]>
  • Loading branch information
achauve and m-maillot authored Jan 10, 2024
1 parent 6ef51ca commit 548d362
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
30 changes: 28 additions & 2 deletions .kontinuous/env/preprod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ hasura:
value: true
envFrom:
- secretRef:
name: pg-user
name: pg-app
- configMapRef:
name: hasura
- secretRef:
Expand All @@ -22,12 +22,37 @@ www:
jobs:
runs:
restore:
~needs: [ pg ]
use: pg-restore
checkout: false
with:
mountPath: /mnt/restore
filterPath: "hasura_prod_db.psql.gz"
restorePath: "${LATEST}"
pgAdminUserSecretRefName: pg-app
env: # there is a bug when setting custom job env, so we have to repeat "with" vars here
- name: RESTORE_PATH
value: "${LATEST}"
- name: OWNER
value: "{{ $.Values.global.pgUser }}"
- name: MOUNT_PATH
value: /mnt/restore
- name: FILTER_PATH
value: hasura_prod_db.psql.gz
- name: PGHOST
value: "pg-rw"
- name: PGDATABASE
value: "{{ $.Values.global.pgDatabase }}"
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: pg-superuser
key: password
- name: PGUSER
valueFrom:
secretKeyRef:
name: pg-superuser
key: user
volumeMounts:
- name: restore
mountPath: /mnt/restore
Expand All @@ -41,10 +66,11 @@ jobs:
secretName: cdtnadminprodserver-backup-credentials
shareName: cdtnadminprodserver-backup-restore
post-restore:
~needs: [restore]
~needs: [ restore ]
use: psql
with:
sqlFile: .kontinuous/sql/post-restore.sql
pgSecretRefName: pg-app
job-ingester:
~needs: [hasura]
use: trigger-cronjob
Expand Down
11 changes: 9 additions & 2 deletions .kontinuous/env/prod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ www:
host: cdtn-admin.fabrique.social.gouv.fr
ingress:
annotations:
nginx.ingress.kubernetes.io/whitelist-source-range: 185.24.184.196,185.24.185.196,185.24.186.196,185.24.187.196,185.24.187.254,164.131.160.1,164.131.160.2,164.131.160.3,164.131.160.4,164.131.160.5,164.131.160.6,164.131.160.17,164.131.160.18,164.131.160.19,164.131.160.20,164.131.160.21,164.131.160.22,164.131.160.33,164.131.160.34,164.131.160.35,164.131.160.36,164.131.160.37,164.131.160.38,164.131.160.49,164.131.160.50,164.131.160.51,164.131.160.52,164.131.160.53,164.131.160.54
nginx.ingress.kubernetes.io/whitelist-source-range: 185.24.184.196,185.24.185.196,185.24.186.196,185.24.187.196,185.24.187.254,164.131.160.1,164.131.160.2,164.131.160.3,164.131.160.4,164.131.160.5,164.131.160.6,164.131.160.17,164.131.160.18,164.131.160.19,164.131.160.20,164.131.160.21,164.131.160.22,164.131.160.33,164.131.160.34,164.131.160.35,164.131.160.36,164.131.160.37,164.131.160.38,164.131.160.49,164.131.160.50,164.131.160.51,164.131.160.52,164.131.160.53,164.131.160.54,45.80.34.219
env:
- name: "FRONTEND_HOST"
value: cdtn-admin.fabrique.social.gouv.fr
Expand All @@ -22,7 +22,7 @@ contributions:
host: cdtn-contributions.fabrique.social.gouv.fr
ingress:
annotations:
nginx.ingress.kubernetes.io/whitelist-source-range: 185.24.184.196,185.24.185.196,185.24.186.196,185.24.187.196,185.24.187.254,164.131.160.1,164.131.160.2,164.131.160.3,164.131.160.4,164.131.160.5,164.131.160.6,164.131.160.17,164.131.160.18,164.131.160.19,164.131.160.20,164.131.160.21,164.131.160.22,164.131.160.33,164.131.160.34,164.131.160.35,164.131.160.36,164.131.160.37,164.131.160.38,164.131.160.49,164.131.160.50,164.131.160.51,164.131.160.52,164.131.160.53,164.131.160.54
nginx.ingress.kubernetes.io/whitelist-source-range: 185.24.184.196,185.24.185.196,185.24.186.196,185.24.187.196,185.24.187.254,164.131.160.1,164.131.160.2,164.131.160.3,164.131.160.4,164.131.160.5,164.131.160.6,164.131.160.17,164.131.160.18,164.131.160.19,164.131.160.20,164.131.160.21,164.131.160.22,164.131.160.33,164.131.160.34,164.131.160.35,164.131.160.36,164.131.160.37,164.131.160.38,164.131.160.49,164.131.160.50,164.131.160.51,164.131.160.52,164.131.160.53,164.131.160.54,45.80.34.219
resources:
limits:
cpu: "100m"
Expand Down Expand Up @@ -50,3 +50,10 @@ hasura:
requests:
cpu: "1000m"
memory: "1Gi"
envFrom:
- secretRef:
name: pg-app
- configMapRef:
name: hasura
- secretRef:
name: hasura
2 changes: 1 addition & 1 deletion .kontinuous/templates/cleanup.job.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ spec:
month' AND status IN ('done', 'rejected');
envFrom:
- secretRef:
name: azure-pg-user
name: pg-app
restartPolicy: Never
{{end}}

0 comments on commit 548d362

Please sign in to comment.