Skip to content

Commit 23b7610

Browse files
committed
feat(helm/raycluster): pass through annotations and podAnnotations
The `annotations` and `podAnnotations` values already exist on `modelSpec` and are wired into the standard (non-Ray) vLLM Deployment via `deployment-vllm-multi.yaml`, but the RayCluster template never consumed them. As a result, users running engines through KubeRay had no way to attach pod-level annotations (e.g. Multus `k8s.v1.cni.cncf.io/networks`) or object-level annotations to their head/worker pods. Mirror the Deployment pattern in `ray-cluster.yaml`: - `modelSpec.annotations` -> RayCluster object metadata - `modelSpec.podAnnotations` -> head and worker pod template metadata No new values are introduced; this only completes the existing passthrough for the KubeRay path. Adds a helm-unittest case asserting both annotation kinds render on the RayCluster. Closes #962 Signed-off-by: Tai An <antai12232931@outlook.com>
1 parent 9b78da7 commit 23b7610

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

helm/templates/ray-cluster.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ kind: RayCluster
99
metadata:
1010
name: "{{ .Release.Name }}-{{$modelSpec.name}}-raycluster"
1111
namespace: {{ .Release.Namespace }}
12+
{{- with $modelSpec.annotations }}
13+
annotations:
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
1216
labels:
1317
model: {{ $modelSpec.name }}
1418
helm-release-name: {{ .Release.Name }}
@@ -20,6 +24,10 @@ spec:
2024
dashboard-host: "0.0.0.0"
2125
template:
2226
metadata:
27+
{{- with $modelSpec.podAnnotations }}
28+
annotations:
29+
{{- toYaml . | nindent 10 }}
30+
{{- end }}
2331
labels:
2432
model: {{ $modelSpec.name }}
2533
helm-release-name: {{ .Release.Name }}
@@ -275,6 +283,10 @@ spec:
275283
groupName: ray
276284
template:
277285
metadata:
286+
{{- with $modelSpec.podAnnotations }}
287+
annotations:
288+
{{- toYaml . | nindent 12 }}
289+
{{- end }}
278290
labels:
279291
model: {{ $modelSpec.name }}
280292
helm-release-name: {{ .Release.Name }}

helm/tests/ray-cluster_test.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,50 @@ tests:
175175
path: spec.workerGroupSpecs[0].template.spec.containers[0].image
176176
value: "vllm/vllm-openai:latest"
177177

178+
- it: should render annotations and podAnnotations on the RayCluster
179+
release:
180+
name: vllm
181+
set:
182+
servingEngineSpec:
183+
enableEngine: true
184+
modelSpec:
185+
- name: "test-model"
186+
repository: "vllm/vllm-openai"
187+
tag: "latest"
188+
modelURL: "facebook/opt-125m"
189+
imagePullSecret: "model-secret"
190+
replicaCount: 1
191+
requestCPU: 1
192+
requestMemory: "1Gi"
193+
requestGPU: 1
194+
annotations:
195+
example.com/owner: team-a
196+
podAnnotations:
197+
k8s.v1.cni.cncf.io/networks: macvlan-conf
198+
raySpec:
199+
enabled: true
200+
headNode:
201+
requestCPU: 1
202+
requestMemory: "1Gi"
203+
requestGPU: 1
204+
asserts:
205+
- documentIndex: 0
206+
equal:
207+
path: kind
208+
value: RayCluster
209+
- documentIndex: 0
210+
equal:
211+
path: metadata.annotations.["example.com/owner"]
212+
value: team-a
213+
- documentIndex: 0
214+
equal:
215+
path: spec.headGroupSpec.template.metadata.annotations.["k8s.v1.cni.cncf.io/networks"]
216+
value: macvlan-conf
217+
- documentIndex: 0
218+
equal:
219+
path: spec.workerGroupSpecs[0].template.metadata.annotations.["k8s.v1.cni.cncf.io/networks"]
220+
value: macvlan-conf
221+
178222
- it: should not render VLLM_API_KEY
179223
release:
180224
name: vllm

0 commit comments

Comments
 (0)