Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions deploy/charts/litellm-helm/templates/migrations-job.yaml
Original file line number Diff line number Diff line change
@@ -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: "ghcr.io/berriai/litellm:main-stable"
command: ["python", "/litellm/proxy/prisma_migration.py"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ .Values.db.secret.name }}
key: url
- name: DISABLE_SCHEMA_UPDATE
value: "{{ .Values.migrationJob.disableSchemaUpdate }}"
restartPolicy: OnFailure
backoffLimit: {{ .Values.migrationJob.backoffLimit }}
9 changes: 9 additions & 0 deletions deploy/charts/litellm-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,12 @@ postgresql:
redis:
enabled: false
architecture: standalone

# Prisma migration job settings
migrationJob:
enabled: true # Enable or disable the schema migration Job
retries: 3 # Number of retries for the Job in case of failure
backoffLimit: 4 # Backoff limit for Job restarts
disableSchemaUpdate: false # Skip schema migrations for specific environments. When True, the job will exit with code 0.