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 optional PodDisruptionBudget for litellm proxy (#14062) (#14093)
Abhinavb6c26c336565
diff --git a/deploy/charts/litellm-helm/Chart.yaml b/deploy/charts/litellm-helm/Chart.yamlindex b6ac264a228..e361ee226b7 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.5+version: 0.4.6# 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/README.md b/deploy/charts/litellm-helm/README.mdindex 86b5918f01c..352c3e9ddff 100644--- a/deploy/charts/litellm-helm/README.md+++ b/deploy/charts/litellm-helm/README.md@@ -41,6 +41,11 @@ If `db.useStackgresOperator` is used (not yet implemented):| `proxyConfigMap.key` | Key in the ConfigMap that contains the proxy config file. | `"config.yaml"` || `proxy_config.*` | See [values.yaml](./values.yaml) for default settings. Rendered into the ConfigMap’s `config.yaml` only when `proxyConfigMap.create=true`. See [example_config_yaml](../../../litellm/proxy/example_config_yaml/) for configuration examples. | `N/A` || `extraContainers[]` | An array of additional containers to be deployed as sidecars alongside the LiteLLM Proxy.+| `pdb.enabled` | Enable a PodDisruptionBudget for the LiteLLM proxy Deployment | `false` |+| `pdb.minAvailable` | Minimum number/percentage of pods that must be available during **voluntary** disruptions (choose **one** of minAvailable/maxUnavailable) | `null` |+| `pdb.maxUnavailable` | Maximum number/percentage of pods that can be unavailable during **voluntary** disruptions (choose **one** of minAvailable/maxUnavailable) | `null` |+| `pdb.annotations` | Extra metadata annotations to add to the PDB | `{}` |+| `pdb.labels` | Extra metadata labels to add to the PDB | `{}` |#### Example `proxy_config` ConfigMap from values (default):diff --git a/deploy/charts/litellm-helm/templates/NOTES.txt b/deploy/charts/litellm-helm/templates/NOTES.txtindex e72c9916080..017bbfa78bd 100644--- a/deploy/charts/litellm-helm/templates/NOTES.txt+++ b/deploy/charts/litellm-helm/templates/NOTES.txt@@ -20,3 +20,4 @@echo "Visit http://127.0.0.1:8080 to use your application"kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT{{- end }}+PDB: {{ if .Values.pdb.enabled }}enabled{{ else }}disabled{{ end }}. Configure via .Values.pdb.*\ No newline at end of filediff --git a/deploy/charts/litellm-helm/templates/poddisruptionbudget.yaml b/deploy/charts/litellm-helm/templates/poddisruptionbudget.yamlnew file mode 100644index 00000000000..1715b94c1f6--- /dev/null+++ b/deploy/charts/litellm-helm/templates/poddisruptionbudget.yaml@@ -0,0 +1,33 @@+{{- /*+PodDisruptionBudget for LiteLLM proxy+Controlled via .Values.pdb.enabled and .Values.pdb.{minAvailable|maxUnavailable}+Only one of minAvailable / maxUnavailable should be set. If both are set, minAvailable wins.+*/ -}}+{{- if .Values.pdb.enabled }}+apiVersion: policy/v1+kind: PodDisruptionBudget+metadata:+ name: {{ include "litellm.fullname" . }}+ labels:+ {{- include "litellm.labels" . | nindent 4 }}+ {{- with .Values.pdb.labels }}+ {{- toYaml . | nindent 4 }}+ {{- end }}+ {{- with .Values.pdb.annotations }}+ annotations:+ {{- toYaml . | nindent 4 }}+ {{- end }}+spec:+ selector:+ matchLabels:+ {{- /* Match the Deployment selector to target the same pod set */ -}}+ {{- include "litellm.selectorLabels" . | nindent 6 }}+ {{- if .Values.pdb.minAvailable }}+ minAvailable: {{ .Values.pdb.minAvailable }}+ {{- else if .Values.pdb.maxUnavailable }}+ maxUnavailable: {{ .Values.pdb.maxUnavailable }}+ {{- else }}+ # Safe default if enabled but not configured+ maxUnavailable: 1+ {{- end }}+{{- end }}diff --git a/deploy/charts/litellm-helm/tests/pdb_tests.yaml b/deploy/charts/litellm-helm/tests/pdb_tests.yamlnew file mode 100644index 00000000000..5e042e80bd3--- /dev/null+++ b/deploy/charts/litellm-helm/tests/pdb_tests.yaml@@ -0,0 +1,45 @@+suite: "pdb enabled"+templates:+ - poddisruptionbudget.yaml+tests:+ - it: "renders a PDB with maxUnavailable=1"+ set:+ pdb.enabled: true+ pdb.maxUnavailable: 1+ asserts:+ - hasDocuments: { count: 1 }+ - isKind: { of: PodDisruptionBudget }+ - equal: { path: apiVersion, value: policy/v1 }+ - equal: { path: spec.maxUnavailable, value: 1 }+ - equal:+ path: spec.selector.matchLabels+ value:+ app.kubernetes.io/name: litellm+ app.kubernetes.io/instance: RELEASE-NAME++---+suite: "pdb disabled"+templates:+ - poddisruptionbudget.yaml+tests:+ - it: "does not render when disabled"+ set:+ pdb.enabled: false+ asserts:+ - hasDocuments: { count: 0 }++---+suite: "pdb minAvailable precedence"+templates:+ - poddisruptionbudget.yaml+tests:+ - it: "uses minAvailable when both are set"+ set:+ pdb.enabled: true+ pdb.minAvailable: "50%"+ pdb.maxUnavailable: 1+ asserts:+ - isKind: { of: PodDisruptionBudget }+ - equal: { path: apiVersion, value: policy/v1 }+ - equal: { path: spec.minAvailable, value: "50%" }+ - isNull: { path: spec.maxUnavailable }diff --git a/deploy/charts/litellm-helm/values.yaml b/deploy/charts/litellm-helm/values.yamlindex 58d1880cd4c..c1792497d29 100644--- a/deploy/charts/litellm-helm/values.yaml+++ b/deploy/charts/litellm-helm/values.yaml@@ -240,4 +240,11 @@ extraEnvVars: {# value: EXTRA_ENV_VAR_VALUE}-+# Pod Disruption Budget+pdb:+ enabled: false+ # Set exactly one of the following. If both are set, minAvailable takes precedence.+ minAvailable: null # e.g. "50%" or 1+ maxUnavailable: null # e.g. 1 or "20%"+ annotations: {}+ labels: {}