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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Helm Chart: Add possibility to override command, args and add deployment labels (#17535)
Lukas de Boer3b8a6ec8885d
diff --git a/deploy/charts/litellm-helm/Chart.yaml b/deploy/charts/litellm-helm/Chart.yamlindex 7f14af7db5d..b77693ba8d5 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.9+version: 0.4.10# 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 todiff --git a/deploy/charts/litellm-helm/templates/deployment.yaml b/deploy/charts/litellm-helm/templates/deployment.yamlindex 316323be99a..0dab2ec40e0 100644--- a/deploy/charts/litellm-helm/templates/deployment.yaml+++ b/deploy/charts/litellm-helm/templates/deployment.yaml@@ -6,6 +6,9 @@ metadata:name: {{ include "litellm.fullname" . }}labels:{{- include "litellm.labels" . | nindent 4 }}+ {{- if .Values.deploymentLabels }}+ {{- toYaml .Values.deploymentLabels | nindent 4 }}+ {{- end }}spec:{{- if not .Values.autoscaling.enabled }}replicas: {{ .Values.replicaCount }}@@ -126,6 +129,12 @@ spec:- configMapRef:name: {{ . }}{{- end }}+ {{- if .Values.command }}+ command: {{ toYaml .Values.command | nindent 12 }}+ {{- end }}+ {{- if .Values.args }}+ args: {{ toYaml .Values.args | nindent 12 }}+ {{- else }}args:- --config- /etc/litellm/config.yaml@@ -133,6 +142,7 @@ spec:- --num_workers- {{ .Values.numWorkers | quote }}{{- end }}+ {{- end }}ports:- name: httpcontainerPort: {{ .Values.service.port }}diff --git a/deploy/charts/litellm-helm/tests/deployment_command_args_labels_tests.yaml b/deploy/charts/litellm-helm/tests/deployment_command_args_labels_tests.yamlnew file mode 100644index 00000000000..6b0d45ebf48--- /dev/null+++ b/deploy/charts/litellm-helm/tests/deployment_command_args_labels_tests.yaml@@ -0,0 +1,68 @@+suite: test deployment command, args, and deploymentLabels+templates:+ - deployment.yaml+ - configmap-litellm.yaml+tests:+ - it: should override args when custom args specified+ template: deployment.yaml+ set:+ args:+ - --custom-arg1+ - value1+ - --custom-arg2+ asserts:+ - equal:+ path: spec.template.spec.containers[0].args+ value:+ - --custom-arg1+ - value1+ - --custom-arg2+ - it: should set custom command when specified+ template: deployment.yaml+ set:+ command:+ - /bin/sh+ - -c+ asserts:+ - equal:+ path: spec.template.spec.containers[0].command+ value:+ - /bin/sh+ - -c+ - it: should set custom command and args together+ template: deployment.yaml+ set:+ command:+ - python+ - -u+ args:+ - my_script.py+ - --verbose+ asserts:+ - equal:+ path: spec.template.spec.containers[0].command+ value:+ - python+ - -u+ - equal:+ path: spec.template.spec.containers[0].args+ value:+ - my_script.py+ - --verbose+ - it: should add deploymentLabels to deployment metadata+ template: deployment.yaml+ set:+ deploymentLabels:+ environment: production+ team: platform+ version: v1.2.3+ asserts:+ - equal:+ path: metadata.labels.environment+ value: production+ - equal:+ path: metadata.labels.team+ value: platform+ - equal:+ path: metadata.labels.version+ value: v1.2.3diff --git a/deploy/charts/litellm-helm/values.yaml b/deploy/charts/litellm-helm/values.yamlindex 35021157826..3a351d7b862 100644--- a/deploy/charts/litellm-helm/values.yaml+++ b/deploy/charts/litellm-helm/values.yaml@@ -30,6 +30,7 @@ serviceAccount:# annotations for litellm deploymentdeploymentAnnotations: {}+deploymentLabels: {}# annotations for litellm podspodAnnotations: {}podLabels: {}@@ -253,6 +254,11 @@ envVars: {}# Additional environment variables to be added to the deployment as a list of k8s env varsextraEnvVars: {}+# if you want to override the container command, you can do so here+command: {}+# if you want to override the container args, you can do so here+args: {}+# - name: EXTRA_ENV_VAR# value: EXTRA_ENV_VAR_VALUE# Pod Disruption Budget