diff --git a/helm/litellm-helm/templates/_helpers.tpl b/helm/litellm-helm/templates/_helpers.tpl index 929fc415163..64d766dee26 100644 --- a/helm/litellm-helm/templates/_helpers.tpl +++ b/helm/litellm-helm/templates/_helpers.tpl @@ -311,6 +311,10 @@ and the same spend transaction buffer. - name: LITELLM_LOG value: {{ .Values.logLevel | quote }} {{- end }} +{{- if and (not (kindIs "invalid" .Values.rustGateway.enabled)) (not (hasKey (default dict .Values.envVars) "LITELLM_RUST_GATEWAY")) }} +- name: LITELLM_RUST_GATEWAY + value: {{ .Values.rustGateway.enabled | toString | quote }} +{{- end }} {{- if .Values.envVars }} {{- range $key, $val := .Values.envVars }} - name: {{ $key }} diff --git a/helm/litellm-helm/tests/rust_gateway_tests.yaml b/helm/litellm-helm/tests/rust_gateway_tests.yaml new file mode 100644 index 00000000000..e13ab41ad6e --- /dev/null +++ b/helm/litellm-helm/tests/rust_gateway_tests.yaml @@ -0,0 +1,52 @@ +suite: Rust forwarding gateway +templates: + - deployment.yaml + - configmap-litellm.yaml +tests: + - it: leaves the image default in place when unset + template: deployment.yaml + asserts: + - notContains: + path: spec.template.spec.containers[0].env + content: + name: LITELLM_RUST_GATEWAY + any: true + - it: turns forwarding off explicitly + template: deployment.yaml + set: + rustGateway.enabled: false + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: LITELLM_RUST_GATEWAY + value: "false" + - it: enables forwarding without changing command or probes + template: deployment.yaml + set: + rustGateway.enabled: true + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: LITELLM_RUST_GATEWAY + value: "true" + - equal: + path: spec.template.spec.containers[0].livenessProbe.httpGet.port + value: http + - it: respects an explicit environment override + template: deployment.yaml + set: + rustGateway.enabled: true + envVars.LITELLM_RUST_GATEWAY: "false" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: LITELLM_RUST_GATEWAY + value: "false" + - notContains: + path: spec.template.spec.containers[0].env + content: + name: LITELLM_RUST_GATEWAY + value: "true" diff --git a/helm/litellm-helm/values.yaml b/helm/litellm-helm/values.yaml index f51f8bdd173..84c04f3b646 100644 --- a/helm/litellm-helm/values.yaml +++ b/helm/litellm-helm/values.yaml @@ -3,6 +3,10 @@ # Declare variables to be passed into your templates. replicaCount: 1 + +rustGateway: + # null inherits the image default; true or false sets LITELLM_RUST_GATEWAY + enabled: liteadmin: enabled: false existingSecret: ""