🚀(helm) transform migrate job to Presync job

Apply db migration before syncing all the pods.
It avoids triggering errors when running the migrate job.
This commit is contained in:
Jacques ROUSSEL
2024-03-26 17:15:56 +01:00
committed by aleb_the_flash
parent 1c4efd523b
commit 7c488a9807
3 changed files with 10 additions and 0 deletions

View File

@@ -5,6 +5,10 @@ apiVersion: batch/v1
kind: Job
metadata:
name: {{ $fullName }}-migrate
{{- with .Values.backend.migrateJobAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "desk.common.labels" (list . $component) | nindent 4 }}
spec:

View File

@@ -88,6 +88,9 @@ backend:
## @param backend.sidecars Add sidecars containers to backend deployment
sidecars: []
## @param backend.migrateJobAnnotations Annotations for the migrate job
migrateJobAnnotations: {}
## @param backend.securityContext Configure backend Pod security context
securityContext: null

View File

@@ -4,6 +4,9 @@ image:
tag: "main"
backend:
migrateJobAnnotations:
argocd.argoproj.io/hook: PreSync
argocd.argoproj.io/hook-delete-policy: HookSucceeded
envVars:
DJANGO_CSRF_TRUSTED_ORIGINS: http://desk-staging.beta.numerique.gouv.fr,https://desk-staging.beta.numerique.gouv.fr
DJANGO_CONFIGURATION: Production