Skip to content

Commit 3bec177

Browse files
redno2YuhanLiu11
andauthored
[Feat] Env from secret (#641)
* add doc/exemple Signed-off-by: Redno2 <[email protected]> * add endFrom secret Signed-off-by: Redno2 <[email protected]> * fix add endFrom secret Signed-off-by: Redno2 <[email protected]> * missing config for initContainer Signed-off-by: Redno2 <[email protected]> --------- Signed-off-by: Redno2 <[email protected]> Co-authored-by: Yuhan Liu <[email protected]>
1 parent df404ba commit 3bec177

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

helm/templates/deployment-vllm-multi.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ spec:
5757
{{- if $container.args }}
5858
args: {{ toYaml $container.args | nindent 12 }}
5959
{{- end }}
60+
{{- if $modelSpec.envFromSecret }}
61+
envFrom:
62+
- secretRef:
63+
name: {{ $modelSpec.envFromSecret.name }}
64+
{{- end }}
6065
env:
6166
- name: RELEASE_NAME
6267
value: {{ $.Release.Name }}
@@ -333,11 +338,17 @@ spec:
333338
value: {{ $modelSpec.lmcacheConfig.workerPort | quote }}
334339
{{- end }}
335340
{{- end }}
336-
{{- if .Values.servingEngineSpec.configs }}
341+
{{- if or .Values.servingEngineSpec.configs $modelSpec.envFromSecret }}
337342
envFrom:
343+
{{- if .Values.servingEngineSpec.configs }}
338344
- configMapRef:
339345
name: "{{ .Release.Name }}-configs"
340346
{{- end }}
347+
{{- if $modelSpec.envFromSecret }}
348+
- secretRef:
349+
name: {{ $modelSpec.envFromSecret.name }}
350+
{{- end }}
351+
{{- end }}
341352
ports:
342353
- name: {{ include "chart.container-port-name" . }}
343354
containerPort: {{ include "chart.container-port" . }}

helm/values.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ servingEngineSpec:
9090
# secretName: "my-existing-secret"
9191
# secretKey: "hf-token-key"
9292
#
93+
# - envFromSecret: (optional) Reference to an existing Kubernetes Secret from which
94+
# all key/value pairs will be loaded as environment variables into the container.
95+
# Example:
96+
# envFromSecret:
97+
# name: s3-registry
98+
#
99+
# The referenced Secret could look like:
100+
# apiVersion: v1
101+
# kind: Secret
102+
# metadata:
103+
# name: s3-registry
104+
# namespace: vllm
105+
# data:
106+
# AWS_ACCESS_KEY_ID: <base64-encoded-value>
107+
# AWS_SECRET_ACCESS_KEY: <base64-encoded-value>
108+
# AWS_ENDPOINT_URL: <base64-encoded-value>
109+
#
93110
# - env: (optional, list) The environment variables to set in the container, e.g., your HF_TOKEN
94111
#
95112
# - nodeSelectorTerms: (optional, list) The node selector terms to match the nodes

0 commit comments

Comments
 (0)