Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

feat(helm): add tpl support to extraContainers and extraInitContainers

CHANGE87d7e86479a9
diff --git a/deploy/charts/litellm-helm/templates/deployment.yaml b/deploy/charts/litellm-helm/templates/deployment.yaml
index 3040fb45d86..97123e5df69 100644
--- a/deploy/charts/litellm-helm/templates/deployment.yaml
+++ b/deploy/charts/litellm-helm/templates/deployment.yaml
@@ -47,7 +47,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.extraInitContainers }}
initContainers:
- {{- toYaml . | nindent 8 }}
+ {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
containers:
- name: {{ include "litellm.name" . }}
@@ -212,7 +212,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.extraContainers }}
- {{- toYaml . | nindent 8 }}
+ {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
volumes:
{{ if .Values.securityContext.readOnlyRootFilesystem }}
diff --git a/deploy/charts/litellm-helm/templates/migrations-job.yaml b/deploy/charts/litellm-helm/templates/migrations-job.yaml
index 8b93a60c1a3..c3f32fe32f3 100644
--- a/deploy/charts/litellm-helm/templates/migrations-job.yaml
+++ b/deploy/charts/litellm-helm/templates/migrations-job.yaml
@@ -37,7 +37,7 @@ spec:
serviceAccountName: {{ include "litellm.migrationServiceAccountName" . }}
{{- with .Values.migrationJob.extraInitContainers }}
initContainers:
- {{- toYaml . | nindent 8 }}
+ {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
containers:
- name: prisma-migrations
@@ -96,7 +96,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.migrationJob.extraContainers }}
- {{- toYaml . | nindent 8 }}
+ {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
diff --git a/deploy/charts/litellm-helm/tests/deployment_tests.yaml b/deploy/charts/litellm-helm/tests/deployment_tests.yaml
index 0d278f25693..b1cbafaf408 100644
--- a/deploy/charts/litellm-helm/tests/deployment_tests.yaml
+++ b/deploy/charts/litellm-helm/tests/deployment_tests.yaml
@@ -319,3 +319,61 @@ tests:
asserts:
- notExists:
path: spec.minReadySeconds
+ - it: should work with extraInitContainers
+ template: deployment.yaml
+ set:
+ extraInitContainers:
+ - name: init-test
+ image: busybox:latest
+ command: ["echo", "hello"]
+ asserts:
+ - contains:
+ path: spec.template.spec.initContainers
+ content:
+ name: init-test
+ image: busybox:latest
+ command: ["echo", "hello"]
+ - it: should support tpl in extraInitContainers
+ template: deployment.yaml
+ set:
+ image:
+ repository: ghcr.io/berriai/litellm-database
+ tag: test
+ extraInitContainers:
+ - name: init-tpl
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ command: ["echo", "hello"]
+ asserts:
+ - contains:
+ path: spec.template.spec.initContainers
+ content:
+ name: init-tpl
+ image: "ghcr.io/berriai/litellm-database:test"
+ command: ["echo", "hello"]
+ - it: should work with extraContainers
+ template: deployment.yaml
+ set:
+ extraContainers:
+ - name: sidecar
+ image: busybox:latest
+ asserts:
+ - contains:
+ path: spec.template.spec.containers
+ content:
+ name: sidecar
+ image: busybox:latest
+ - it: should support tpl in extraContainers
+ template: deployment.yaml
+ set:
+ image:
+ repository: ghcr.io/berriai/litellm-database
+ tag: test
+ extraContainers:
+ - name: sidecar-tpl
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ asserts:
+ - contains:
+ path: spec.template.spec.containers
+ content:
+ name: sidecar-tpl
+ image: "ghcr.io/berriai/litellm-database:test"
diff --git a/deploy/charts/litellm-helm/tests/migrations-job_tests.yaml b/deploy/charts/litellm-helm/tests/migrations-job_tests.yaml
index ee684c3c3d7..05dd37b4857 100644
--- a/deploy/charts/litellm-helm/tests/migrations-job_tests.yaml
+++ b/deploy/charts/litellm-helm/tests/migrations-job_tests.yaml
@@ -188,3 +188,69 @@ tests:
- equal:
path: spec.template.spec.serviceAccountName
value: pre-existing-sa
+ - it: should work with extraInitContainers
+ template: migrations-job.yaml
+ set:
+ migrationJob:
+ enabled: true
+ extraInitContainers:
+ - name: init-test
+ image: busybox:latest
+ command: ["echo", "hello"]
+ asserts:
+ - contains:
+ path: spec.template.spec.initContainers
+ content:
+ name: init-test
+ image: busybox:latest
+ command: ["echo", "hello"]
+ - it: should support tpl in extraInitContainers
+ template: migrations-job.yaml
+ set:
+ image:
+ repository: ghcr.io/berriai/litellm-database
+ tag: test
+ migrationJob:
+ enabled: true
+ extraInitContainers:
+ - name: init-tpl
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ command: ["echo", "hello"]
+ asserts:
+ - contains:
+ path: spec.template.spec.initContainers
+ content:
+ name: init-tpl
+ image: "ghcr.io/berriai/litellm-database:test"
+ command: ["echo", "hello"]
+ - it: should work with extraContainers
+ template: migrations-job.yaml
+ set:
+ migrationJob:
+ enabled: true
+ extraContainers:
+ - name: sidecar
+ image: busybox:latest
+ asserts:
+ - contains:
+ path: spec.template.spec.containers
+ content:
+ name: sidecar
+ image: busybox:latest
+ - it: should support tpl in extraContainers
+ template: migrations-job.yaml
+ set:
+ image:
+ repository: ghcr.io/berriai/litellm-database
+ tag: test
+ migrationJob:
+ enabled: true
+ extraContainers:
+ - name: sidecar-tpl
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ asserts:
+ - contains:
+ path: spec.template.spec.containers
+ content:
+ name: sidecar-tpl
+ image: "ghcr.io/berriai/litellm-database:test"