From 92832a616890b035b56e7f4caaf0aeaa2b965014 Mon Sep 17 00:00:00 2001 From: Enrico Mano Date: Tue, 29 Jul 2025 15:35:27 +0200 Subject: [PATCH 1/2] Use emptyDir as pvcStorage Signed-off-by: Enrico Mano --- helm/templates/deployment-vllm-multi.yaml | 5 ++++- helm/templates/pvc.yaml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/helm/templates/deployment-vllm-multi.yaml b/helm/templates/deployment-vllm-multi.yaml index ccbfa943b..e5268b4c3 100644 --- a/helm/templates/deployment-vllm-multi.yaml +++ b/helm/templates/deployment-vllm-multi.yaml @@ -377,7 +377,10 @@ spec: {{- if or (hasKey $modelSpec "pvcStorage") (and $modelSpec.vllmConfig (hasKey $modelSpec.vllmConfig "tensorParallelSize")) (hasKey $modelSpec "chatTemplate") (hasKey $modelSpec "extraVolumes") (hasKey $.Values "sharedPvcStorage") }} volumes: {{- end}} - {{- if hasKey $modelSpec "pvcStorage" }} + {{- if eq (toString $modelSpec.pvcStorage) "emptyDir" }} + - name: {{ .Release.Name }}-storage + emptyDir: {} + {{- else if hasKey $modelSpec "pvcStorage" }} - name: {{ .Release.Name }}-storage persistentVolumeClaim: claimName: "{{ .Release.Name }}-{{$modelSpec.name}}-storage-claim" diff --git a/helm/templates/pvc.yaml b/helm/templates/pvc.yaml index 9aef85785..d9cace6ed 100644 --- a/helm/templates/pvc.yaml +++ b/helm/templates/pvc.yaml @@ -3,6 +3,7 @@ {{- range $modelSpec := .Values.servingEngineSpec.modelSpec }} {{- with $ -}} {{- if and (hasKey $modelSpec "pvcStorage") (not (empty $modelSpec.pvcStorage)) }} +{{- if ne (toString $modelSpec.pvcStorage) "emptyDir" }} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -28,6 +29,7 @@ spec: {{- end }} {{- end }} {{- end }} +{{- end }} --- {{- end }} {{- end }} From 80a53f508f793cce43559a252b64105a6294338b Mon Sep 17 00:00:00 2001 From: Enrico Mano Date: Wed, 30 Jul 2025 10:00:48 +0200 Subject: [PATCH 2/2] Fix Gemini comments with more robust type checking Signed-off-by: Enrico Mano --- helm/templates/deployment-vllm-multi.yaml | 10 ++++++---- helm/templates/pvc.yaml | 4 +--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/templates/deployment-vllm-multi.yaml b/helm/templates/deployment-vllm-multi.yaml index e5268b4c3..db5755a59 100644 --- a/helm/templates/deployment-vllm-multi.yaml +++ b/helm/templates/deployment-vllm-multi.yaml @@ -377,14 +377,16 @@ spec: {{- if or (hasKey $modelSpec "pvcStorage") (and $modelSpec.vllmConfig (hasKey $modelSpec.vllmConfig "tensorParallelSize")) (hasKey $modelSpec "chatTemplate") (hasKey $modelSpec "extraVolumes") (hasKey $.Values "sharedPvcStorage") }} volumes: {{- end}} - {{- if eq (toString $modelSpec.pvcStorage) "emptyDir" }} - - name: {{ .Release.Name }}-storage - emptyDir: {} - {{- else if hasKey $modelSpec "pvcStorage" }} + {{- if hasKey $modelSpec "pvcStorage" }} - name: {{ .Release.Name }}-storage + {{- if and (kindIs "map" $modelSpec.pvcStorage) (hasKey $modelSpec.pvcStorage "emptyDir") }} + emptyDir: + {{- toYaml $modelSpec.pvcStorage.emptyDir | nindent 12 }} + {{- else if kindIs "string" $modelSpec.pvcStorage }} persistentVolumeClaim: claimName: "{{ .Release.Name }}-{{$modelSpec.name}}-storage-claim" {{- end }} + {{- end }} {{- if hasKey $.Values "sharedPvcStorage" }} - name: {{ .Release.Name }}-shared-pvc-storage persistentVolumeClaim: diff --git a/helm/templates/pvc.yaml b/helm/templates/pvc.yaml index d9cace6ed..c67b88692 100644 --- a/helm/templates/pvc.yaml +++ b/helm/templates/pvc.yaml @@ -2,8 +2,7 @@ {{- if .Values.servingEngineSpec.enableEngine -}} {{- range $modelSpec := .Values.servingEngineSpec.modelSpec }} {{- with $ -}} -{{- if and (hasKey $modelSpec "pvcStorage") (not (empty $modelSpec.pvcStorage)) }} -{{- if ne (toString $modelSpec.pvcStorage) "emptyDir" }} +{{- if and (hasKey $modelSpec "pvcStorage") (not (empty $modelSpec.pvcStorage)) (kindIs "string" $modelSpec.pvcStorage) }} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -29,7 +28,6 @@ spec: {{- end }} {{- end }} {{- end }} -{{- end }} --- {{- end }} {{- end }}