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: add extraEnvVars to the helm deployment (#9292)

Manuel Cañetec4ea1ab61b88
diff --git a/deploy/charts/litellm-helm/Chart.yaml b/deploy/charts/litellm-helm/Chart.yaml
index 4d856fdc0f0..5de591fd730 100644
--- a/deploy/charts/litellm-helm/Chart.yaml
+++ b/deploy/charts/litellm-helm/Chart.yaml
@@ -18,7 +18,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
-version: 0.4.2
+version: 0.4.3
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
diff --git a/deploy/charts/litellm-helm/templates/deployment.yaml b/deploy/charts/litellm-helm/templates/deployment.yaml
index 52f761ed15a..5b9488c19bf 100644
--- a/deploy/charts/litellm-helm/templates/deployment.yaml
+++ b/deploy/charts/litellm-helm/templates/deployment.yaml
@@ -97,6 +97,9 @@ spec:
value: {{ $val | quote }}
{{- end }}
{{- end }}
+ {{- with .Values.extraEnvVars }}
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
envFrom:
{{- range .Values.environmentSecrets }}
- secretRef:
diff --git a/deploy/charts/litellm-helm/tests/deployment_tests.yaml b/deploy/charts/litellm-helm/tests/deployment_tests.yaml
index 0e4b8e0b1fd..b71f91377f1 100644
--- a/deploy/charts/litellm-helm/tests/deployment_tests.yaml
+++ b/deploy/charts/litellm-helm/tests/deployment_tests.yaml
@@ -80,3 +80,38 @@ tests:
secretKeyRef:
name: my-secret
key: my-key
+ - it: should work with extraEnvVars
+ template: deployment.yaml
+ set:
+ extraEnvVars:
+ - name: EXTRA_ENV_VAR
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.labels['env']
+ asserts:
+ - contains:
+ path: spec.template.spec.containers[0].env
+ content:
+ name: EXTRA_ENV_VAR
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.labels['env']
+ - it: should work with both extraEnvVars and envVars
+ template: deployment.yaml
+ set:
+ envVars:
+ ENV_VAR: ENV_VAR_VALUE
+ extraEnvVars:
+ - name: EXTRA_ENV_VAR
+ value: EXTRA_ENV_VAR_VALUE
+ asserts:
+ - contains:
+ path: spec.template.spec.containers[0].env
+ content:
+ name: ENV_VAR
+ value: ENV_VAR_VALUE
+ - contains:
+ path: spec.template.spec.containers[0].env
+ content:
+ name: EXTRA_ENV_VAR
+ value: EXTRA_ENV_VAR_VALUE
diff --git a/deploy/charts/litellm-helm/values.yaml b/deploy/charts/litellm-helm/values.yaml
index 70f6c2ef230..0440e28eed0 100644
--- a/deploy/charts/litellm-helm/values.yaml
+++ b/deploy/charts/litellm-helm/values.yaml
@@ -195,9 +195,15 @@ migrationJob:
annotations: {}
ttlSecondsAfterFinished: 120
-# Additional environment variables to be added to the deployment
+# Additional environment variables to be added to the deployment as a map of key-value pairs
envVars: {
# USE_DDTRACE: "true"
}
+# Additional environment variables to be added to the deployment as a list of k8s env vars
+extraEnvVars: {
+ # - name: EXTRA_ENV_VAR
+ # value: EXTRA_ENV_VAR_VALUE
+}
+