From f6cb627b81e20e80c010c4a3a85fdfb804ba2bf4 Mon Sep 17 00:00:00 2001 From: Ralf Grubenmann Date: Mon, 26 Oct 2026 10:00:09 +0100 Subject: [PATCH] feat: allow setting custom env vars --- README.md | 8 ++++++++ templates/models/knative-serving.yaml | 6 ++++++ tools/helm/lint-values.yaml | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/README.md b/README.md index be7ea4a..99a988f 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,14 @@ models: chatTemplate: # if you want to use a custom chat template. Usually left empty. The template must exist in the docker image to work repository: tag: + env: # optional: extra environment variables to set on the model container. + - name: MY_VAR + value: my-value + - name: SECRET_VAR + valueFrom: + secretKeyRef: + name: my-secret + key: my-key resources: # the compute resources to request requests: # specifies typical usage requests cpu: 1 diff --git a/templates/models/knative-serving.yaml b/templates/models/knative-serving.yaml index 9b419e9..c398462 100644 --- a/templates/models/knative-serving.yaml +++ b/templates/models/knative-serving.yaml @@ -36,6 +36,9 @@ spec: value: "0.0.0.0" - name: VERBOSE value: "true" + {{- if $model.env }} + {{- toYaml $model.env | nindent 12 }} + {{- end }} startupProbe: httpGet: path: /health @@ -190,6 +193,9 @@ spec: {{- if or $persistence.enabled $cacheDir }} - name: VLLM_CACHE_ROOT value: {{ $cachePath }}/.cache/vllm + {{- end }} + {{- if $model.env }} + {{- toYaml $model.env | nindent 12 }} {{- end }} startupProbe: httpGet: diff --git a/tools/helm/lint-values.yaml b/tools/helm/lint-values.yaml index 85e9266..4fe4319 100644 --- a/tools/helm/lint-values.yaml +++ b/tools/helm/lint-values.yaml @@ -22,6 +22,14 @@ models: internal: true apiKey: dummy persistence: { enabled: true } # renders models/pvc.yaml and the chart-owned claim + env: # exercises the custom env vars templated into knative-serving.yaml + - name: MODEL_CUSTOM_VAR + value: custom-value + - name: MODEL_SECRET_VAR + valueFrom: + secretKeyRef: + name: my-secret + key: my-key resources: requests: { cpu: 1, memory: 1G } limits: { cpu: 2, memory: 2G }