Helm Chart: Added ability to specify extra annotations to the SQLMigration job (#22781)

Added the ability to add extra annotations to the SQL migration job

This is required for ArgoCD to properly handle the Job after it has been
deleted
See
https://argo-cd.readthedocs.io/en/stable/user-guide/resource_hooks/#hook-deletion-policies
This commit is contained in:
Sebastien Termeau 2024-10-17 16:08:16 +02:00 committed by GitHub
parent 97ef401bea
commit e918aa4366
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -10,13 +10,14 @@ metadata:
name: fleet-migration
namespace: {{ .Release.Namespace }}
annotations:
{{- if .Values.mysql.enabled }}
{}
{{- else }}
{{- if not .Values.mysql.enabled }}
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": hook-succeeded
{{- end }}
{{- with .Values.fleet.migrationJobAnnotations }}
{{- toYaml . | trim | nindent 4 }}
{{- end }}
spec:
ttlSecondsAfterFinished: 100
template:

View file

@ -65,6 +65,8 @@ fleet:
secretName: fleet
# Whether or not to run `fleet db prepare` to run SQL migrations before starting Fleet
autoApplySQLMigrations: true
# Add extra annotations to the migration Job
migrationJobAnnotations:
tls:
enabled: true
# Set to true if you need a separate secret for just TLS data.