mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
feat(helm): migration job annotation control
This commit is contained in:
parent
d3891e6eae
commit
9a1da12776
3 changed files with 48 additions and 4 deletions
|
|
@ -7,13 +7,16 @@ metadata:
|
|||
labels:
|
||||
{{- include "litellm.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
{{- with .Values.migrationJob.jobAnnotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.migrationJob.hooks.argocd.enabled }}
|
||||
argocd.argoproj.io/hook: PreSync
|
||||
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
|
||||
argocd.argoproj.io/hook: {{ .Values.migrationJob.hooks.argocd.hook | default "PreSync" | quote }}
|
||||
argocd.argoproj.io/hook-delete-policy: {{ .Values.migrationJob.hooks.argocd.hookDeletePolicy | default "BeforeHookCreation" | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.migrationJob.hooks.helm.enabled }}
|
||||
helm.sh/hook: "pre-install,pre-upgrade"
|
||||
helm.sh/hook-delete-policy: "before-hook-creation"
|
||||
helm.sh/hook: {{ .Values.migrationJob.hooks.helm.hook | default "pre-install,pre-upgrade" | quote }}
|
||||
helm.sh/hook-delete-policy: {{ .Values.migrationJob.hooks.helm.hookDeletePolicy | default "before-hook-creation" | quote }}
|
||||
helm.sh/hook-weight: {{ .Values.migrationJob.hooks.helm.weight | default "1" | quote }}
|
||||
{{- end }}
|
||||
checksum/config: {{ toYaml .Values | sha256sum }}
|
||||
|
|
|
|||
|
|
@ -254,3 +254,35 @@ tests:
|
|||
content:
|
||||
name: sidecar-tpl
|
||||
image: "ghcr.io/berriai/litellm-database:test"
|
||||
- it: should set annotations on migrations job properly
|
||||
template: migrations-job.yaml
|
||||
set:
|
||||
migrationJob:
|
||||
enabled: true
|
||||
jobAnnotations:
|
||||
test: test1
|
||||
hooks:
|
||||
argocd:
|
||||
enabled: true
|
||||
hook: test2
|
||||
hookDeletePolicy: test3
|
||||
helm:
|
||||
enabled: true
|
||||
hook: test4
|
||||
hookDeletePolicy: test5
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations['test']
|
||||
value: test1
|
||||
- equal:
|
||||
path: metadata.annotations['argocd.argoproj.io/hook']
|
||||
value: test2
|
||||
- equal:
|
||||
path: metadata.annotations['argocd.argoproj.io/hook-delete-policy']
|
||||
value: test3
|
||||
- equal:
|
||||
path: metadata.annotations['helm.sh/hook']
|
||||
value: test4
|
||||
- equal:
|
||||
path: metadata.annotations['helm.sh/hook-delete-policy']
|
||||
value: test5
|
||||
|
|
|
|||
|
|
@ -313,6 +313,9 @@ migrationJob:
|
|||
# Only used when migrationJob.hooks.helm.enabled=true and serviceAccount.create=true.
|
||||
# In that case, pre-install/pre-upgrade hooks run before normal resources, so this defaults to "default".
|
||||
serviceAccountName: ""
|
||||
# extra annotations for the Job
|
||||
jobAnnotations: {}
|
||||
# extra annotations for pods created from the Job
|
||||
annotations: {}
|
||||
ttlSecondsAfterFinished: 120
|
||||
resources: {}
|
||||
|
|
@ -326,8 +329,14 @@ migrationJob:
|
|||
hooks:
|
||||
argocd:
|
||||
enabled: true
|
||||
# Optional hook controls (defaults shown)
|
||||
# hook: PreSync
|
||||
# hookDeletePolicy: BeforeHookCreation
|
||||
helm:
|
||||
enabled: false
|
||||
# Optional hook controls (defaults shown)
|
||||
# hook: pre-install,pre-upgrade
|
||||
# hookDeletePolicy: before-hook-creation
|
||||
|
||||
# Additional environment variables to be added to the deployment as a map of key-value pairs
|
||||
envVars: {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue