diff --git a/deploy/charts/litellm-helm/templates/migrations-job.yaml b/deploy/charts/litellm-helm/templates/migrations-job.yaml new file mode 100644 index 000000000..64aa9d3c5 --- /dev/null +++ b/deploy/charts/litellm-helm/templates/migrations-job.yaml @@ -0,0 +1,27 @@ +""" +This job runs the prisma migrations for the LiteLLM DB. +""" +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "litellm.fullname" . }}-migrations + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "0" +spec: + template: + spec: + containers: + - name: prisma-migrations + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + command: ["python", "/path/to/prisma_migration.py"] + env: + - name: DATABASE_URL + valueFrom: + secretKeyRef: + name: {{ .Values.secrets.databaseSecret }} + key: database_url + - name: DISABLE_SCHEMA_UPDATE + value: "False" # Toggle this for environments like review labs + restartPolicy: OnFailure + backoffLimit: 3