[Bugfix][Helm] Fix chart resource references (#51664)

Signed-off-by: iwannagotobed <us990704@yonsei.ac.kr> Co-authored-by: Chauncey <chaunceyjiang@gmail.com>

iwannagotobed committed Aug 14, 2026 at 18:47 UTC aa3100357322995b201d5348c5490596a7bd70a9
9 files changed +84 -17
examples/deployment/chart-helm/Chart.yaml
+1 -1
@@ -15,7 +15,7 @@ type: application
15 # This is the chart version. This version number should be incremented each time you make changes
16 # to the chart and its templates, including the app version.
17 # Versions are expected to follow Semantic Versioning (https://semver.org/)
18 -version: 0.0.1
18 +version: 0.0.2
19
20 maintainers:
21 - name: mfournioux
examples/deployment/chart-helm/templates/_helpers.tpl
+9 -2
@@ -12,10 +12,17 @@ Define service name
12 {{- if .Values.serviceName }}
13 {{- .Values.serviceName | lower | trim }}
14 {{- else }}
15 -"{{ .Release.Name }}-service"
15 +{{- printf "%s-service" .Release.Name }}
16 {{- end }}
17 {{- end }}
18
19 +{{/*
20 +Define deployment name
21 +*/}}
22 +{{- define "chart.deployment-name" -}}
23 +{{- printf "%s-deployment-vllm" .Release.Name }}
24 +{{- end }}
25 +
26 {{/*
27 Define service port
28 */}}
@@ -162,4 +169,4 @@ runAsUser:
169 {{- with .Values.labels -}}
170 {{ toYaml . }}
171 {{- end }}
165 -{{- end }}
\ No newline at end of file
172 +{{- end }}
examples/deployment/chart-helm/templates/deployment.yaml
+5 -7
@@ -1,23 +1,21 @@
1 apiVersion: apps/v1
2 kind: Deployment
3 metadata:
4 - name: "{{ .Release.Name }}-deployment-vllm"
4 + name: {{ include "chart.deployment-name" . | quote }}
5 namespace: {{ .Release.Namespace }}
6 labels:
7 {{- include "chart.labels" . | nindent 4 }}
8 spec:
9 replicas: {{ .Values.replicaCount }}
10 {{- include "chart.strategy" . | nindent 2 }}
11 - selector:
11 + selector:
12 matchLabels:
13 - environment: "test"
14 - release: "test"
13 + {{- include "chart.labels" . | nindent 6 }}
14 progressDeadlineSeconds: 1200
15 template:
16 metadata:
17 labels:
19 - environment: "test"
20 - release: "test"
18 + {{- include "chart.labels" . | nindent 8 }}
19 spec:
20 containers:
21 - name: "vllm"
@@ -128,4 +126,4 @@ spec:
126 values:
127 {{- toYaml . | nindent 20 }}
128 {{- end }}
131 - {{- end }}
\ No newline at end of file
129 + {{- end }}
examples/deployment/chart-helm/templates/hpa.yaml
+2 -2
@@ -8,7 +8,7 @@ spec:
8 scaleTargetRef:
9 apiVersion: apps/v1
10 kind: Deployment
11 - name: vllm
11 + name: {{ include "chart.deployment-name" . | quote }}
12 minReplicas: {{ .Values.autoscaling.minReplicas }}
13 maxReplicas: {{ .Values.autoscaling.maxReplicas }}
14 metrics:
@@ -28,4 +28,4 @@ spec:
28 type: Utilization
29 averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
30 {{- end }}
31 -{{- end }}
\ No newline at end of file
31 +{{- end }}
examples/deployment/chart-helm/templates/service.yaml
+2 -2
@@ -1,7 +1,7 @@
1 apiVersion: v1
2 kind: Service
3 metadata:
4 - name: "{{ .Release.Name }}-service"
4 + name: {{ include "chart.service-name" . | quote }}
5 namespace: {{ .Release.Namespace }}
6 spec:
7 type: ClusterIP
@@ -11,4 +11,4 @@ spec:
11 targetPort: {{ include "chart.container-port-name" . }}
12 protocol: TCP
13 selector:
14 - {{- include "chart.labels" . | nindent 4 }}
\ No newline at end of file
14 + {{- include "chart.labels" . | nindent 4 }}
examples/deployment/chart-helm/tests/deployment_test.yaml
+18 -1
@@ -2,6 +2,23 @@ suite: test deployment
2 templates:
3 - deployment.yaml
4 tests:
5 + - it: should use configured labels for the deployment selector and pods
6 + set:
7 + labels:
8 + environment: production
9 + release: qwen-serving
10 + asserts:
11 + - equal:
12 + path: spec.selector.matchLabels
13 + value:
14 + environment: production
15 + release: qwen-serving
16 + - equal:
17 + path: spec.template.metadata.labels
18 + value:
19 + environment: production
20 + release: qwen-serving
21 +
22 - it: should create wait-download-model init container when modelDownload is enabled
23 set:
24 extraInit:
@@ -132,4 +149,4 @@ tests:
149 value: ghcr.io/llm-d/llm-d-routing-sidecar:v0.2.0
150 - equal:
151 path: spec.template.spec.initContainers[1].ports[0].containerPort
135 - value: 8080
\ No newline at end of file
152 + value: 8080
examples/deployment/chart-helm/tests/hpa_test.yaml new
+17
@@ -0,0 +1,17 @@
1 +suite: test horizontal pod autoscaler
2 +templates:
3 + - hpa.yaml
4 +release:
5 + name: demo
6 +tests:
7 + - it: should target the deployment created by this release
8 + set:
9 + autoscaling:
10 + enabled: true
11 + minReplicas: 1
12 + maxReplicas: 3
13 + targetCPUUtilizationPercentage: 80
14 + asserts:
15 + - equal:
16 + path: spec.scaleTargetRef.name
17 + value: demo-deployment-vllm
examples/deployment/chart-helm/tests/service_test.yaml new
+25
@@ -0,0 +1,25 @@
1 +suite: test service
2 +templates:
3 + - service.yaml
4 +release:
5 + name: demo
6 +tests:
7 + - it: should honor the configured service name
8 + set:
9 + serviceName: vllm-api
10 + asserts:
11 + - equal:
12 + path: metadata.name
13 + value: vllm-api
14 +
15 + - it: should select pods using the configured labels
16 + set:
17 + labels:
18 + environment: production
19 + release: qwen-serving
20 + asserts:
21 + - equal:
22 + path: spec.selector
23 + value:
24 + environment: production
25 + release: qwen-serving
examples/deployment/chart-helm/values.schema.json
+5 -2
@@ -28,7 +28,10 @@
28 "type": "integer"
29 },
30 "serviceName": {
31 - "type": "null"
31 + "type": [
32 + "null",
33 + "string"
34 + ]
35 },
36 "servicePort": {
37 "type": "integer"
@@ -326,4 +329,4 @@
329 "secrets",
330 "servicePort"
331 ]
329 -}
\ No newline at end of file
332 +}