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]

Litellm feat helm lifecycle support (#18517)

Mehmet Can Şakiroğlua3503e59c227
diff --git a/deploy/charts/litellm-helm/templates/deployment.yaml b/deploy/charts/litellm-helm/templates/deployment.yaml
index 0dab2ec40e0..19fa0479091 100644
--- a/deploy/charts/litellm-helm/templates/deployment.yaml
+++ b/deploy/charts/litellm-helm/templates/deployment.yaml
@@ -182,6 +182,10 @@ spec:
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
+ {{- with .Values.lifecycle }}
+ lifecycle:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
{{- with .Values.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
diff --git a/deploy/charts/litellm-helm/tests/deployment_tests.yaml b/deploy/charts/litellm-helm/tests/deployment_tests.yaml
index f9c83966696..182a2362392 100644
--- a/deploy/charts/litellm-helm/tests/deployment_tests.yaml
+++ b/deploy/charts/litellm-helm/tests/deployment_tests.yaml
@@ -136,4 +136,26 @@ tests:
path: spec.template.spec.containers[0].volumeMounts
content:
name: litellm-config
- mountPath: /etc/litellm/
\ No newline at end of file
+ mountPath: /etc/litellm/
+ - it: should work with lifecycle hooks
+ template: deployment.yaml
+ set:
+ lifecycle:
+ preStop:
+ exec:
+ command:
+ - /bin/sh
+ - -c
+ - echo "Container stopping"
+ asserts:
+ - exists:
+ path: spec.template.spec.containers[0].lifecycle
+ - equal:
+ path: spec.template.spec.containers[0].lifecycle.preStop.exec.command[0]
+ value: /bin/sh
+ - equal:
+ path: spec.template.spec.containers[0].lifecycle.preStop.exec.command[1]
+ value: -c
+ - equal:
+ path: spec.template.spec.containers[0].lifecycle.preStop.exec.command[2]
+ value: echo "Container stopping"
\ No newline at end of file