From 120ce7392be98951d7e34aaf37e9bf6a2a8f8bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandra=20Tatarevi=C4=87ov=C3=A1?= Date: Fri, 13 Aug 2021 08:20:37 +0200 Subject: [PATCH] Add support for mounting PVCs --- deploy/charts/ray/Chart.yaml | 2 +- deploy/charts/ray/templates/raycluster.yaml | 17 +++++++++++++++++ deploy/charts/ray/values.yaml | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/deploy/charts/ray/Chart.yaml b/deploy/charts/ray/Chart.yaml index b2148b1ace24..d6c20f8c3e90 100644 --- a/deploy/charts/ray/Chart.yaml +++ b/deploy/charts/ray/Chart.yaml @@ -4,7 +4,7 @@ description: A Helm chart for deployments of Ray on Kubernetes. type: application # Chart version. -version: 0.1.0 +version: 0.1.0-1 # Ray version. appVersion: "latest" diff --git a/deploy/charts/ray/templates/raycluster.yaml b/deploy/charts/ray/templates/raycluster.yaml index 65cb9ab9b15d..0f88a3452c55 100644 --- a/deploy/charts/ray/templates/raycluster.yaml +++ b/deploy/charts/ray/templates/raycluster.yaml @@ -39,6 +39,11 @@ spec: - name: dshm emptyDir: medium: Memory + {{- range $volume := .persistentVolumes }} + - name: {{ $volume.claimName }} + persistentVolumeClaim: + claimName: {{ $volume.claimName }} + {{- end }} containers: - name: ray-node imagePullPolicy: Always @@ -59,6 +64,18 @@ spec: volumeMounts: - mountPath: /dev/shm name: dshm + {{- range $volume := .persistentVolumes }} + {{- range $mount := $volume.mounts }} + - name: {{ $volume.claimName }} + mountPath: {{ $mount.mountPath }} + {{- if $mount.subPath }} + subPath: {{ $mount.subPath }} + {{- end }} + {{- if $mount.readOnly }} + readOnly: {{ $mount.readOnly }} + {{- end }} + {{- end }} + {{- end }} resources: requests: cpu: {{ .CPU }} diff --git a/deploy/charts/ray/values.yaml b/deploy/charts/ray/values.yaml index e72139be8bc6..b527f369ef36 100644 --- a/deploy/charts/ray/values.yaml +++ b/deploy/charts/ray/values.yaml @@ -31,6 +31,8 @@ podTypes: rayResources: {} # Optionally, set a node selector for this podType: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector nodeSelector: {} + # PersistentVolumeClaim mounts + persistentVolumes: [] # The key for each podType is a user-defined string. rayWorkerType: # minWorkers is the minimum number of Ray workers of this pod type to keep running. @@ -53,6 +55,8 @@ podTypes: rayResources: {} # Optionally, set a node selector for this Pod type. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector nodeSelector: {} + # PersistentVolumeClaim mounts + persistentVolumes: [] # Operator settings: