This commit is contained in:
yujonglee 2026-11-03 19:02:45 +00:00 • committed by GitHub
commit 380553dcfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 130 additions and 0 deletions

View file

@ -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")) }}
- name: LITELLM_RUST
value: {{ .Values.rustGateway.enabled | toString | quote }}
{{- end }}
{{- if .Values.envVars }}
{{- range $key, $val := .Values.envVars }}
- name: {{ $key }}

View file

@ -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
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
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
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: "false"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: LITELLM_RUST
value: "false"
- notContains:
path: spec.template.spec.containers[0].env
content:
name: LITELLM_RUST
value: "true"

View file

@ -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
enabled:
liteadmin:
enabled: false
existingSecret: ""

View file

@ -60,6 +60,17 @@ spec:
- name: LITELLM_CORS_ORIGINS
value: {{ include "litellm.ui.publicOrigin" . | quote }}
{{- end }}
{{- $rustGateway := .Values.gateway.rustGateway | default dict }}
{{- $rustGatewayOverridden := false }}
{{- range .Values.gateway.extraEnv }}
{{- if eq .name "LITELLM_RUST" }}
{{- $rustGatewayOverridden = true }}
{{- end }}
{{- end }}
{{- if and (not (kindIs "invalid" $rustGateway.enabled)) (not $rustGatewayOverridden) }}
- name: LITELLM_RUST
value: {{ $rustGateway.enabled | toString | quote }}
{{- end }}
{{- include "litellm.serverEnv" (dict "root" $ "component" .Values.gateway) | nindent 12 }}
{{- if .Values.gateway.config.create }}
- name: CONFIG_FILE_PATH

View file

@ -0,0 +1,56 @@
suite: Rust forwarding gateway
templates:
- gateway/deployment.yaml
- gateway/configmap.yaml
values:
- ./values/required.yaml
tests:
- it: leaves the image default in place when unset
template: gateway/deployment.yaml
asserts:
- notContains:
path: spec.template.spec.containers[0].env
content:
name: LITELLM_RUST
any: true
- it: turns forwarding off explicitly
template: gateway/deployment.yaml
set:
gateway.rustGateway.enabled: false
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: LITELLM_RUST
value: "false"
- it: enables forwarding without changing command or probes
template: gateway/deployment.yaml
set:
gateway.rustGateway.enabled: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: LITELLM_RUST
value: "true"
- equal:
path: spec.template.spec.containers[0].livenessProbe.httpGet.port
value: http
- it: respects an explicit extraEnv override
template: gateway/deployment.yaml
set:
gateway.rustGateway.enabled: true
gateway.extraEnv:
- name: LITELLM_RUST
value: "false"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: LITELLM_RUST
value: "false"
- notContains:
path: spec.template.spec.containers[0].env
content:
name: LITELLM_RUST
value: "true"

View file

@ -303,6 +303,9 @@ gateway:
# Number of uvicorn worker processes per gateway pod. Sets NUM_WORKERS,
# consumed by the gateway image entrypoint. Default is 1.
numWorkers: 1
rustGateway:
# null inherits the image default; true or false sets LITELLM_RUST
enabled:
extraEnv: [] # Add extra environment variables to the gateway
envConfigMaps: [] # Add extra environment variables to the gateway from config maps
envSecrets: [] # Add extra environment variables to the gateway from secrets