diff --git a/helm-chart/ray-cluster/templates/raycluster-cluster.yaml b/helm-chart/ray-cluster/templates/raycluster-cluster.yaml index 665560a7c2..90d81a646d 100644 --- a/helm-chart/ray-cluster/templates/raycluster-cluster.yaml +++ b/helm-chart/ray-cluster/templates/raycluster-cluster.yaml @@ -32,6 +32,9 @@ spec: template: spec: imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 10 }} + {{- if .Values.head.serviceAccountName }} + serviceAccountName: {{ .Values.head.serviceAccountName }} + {{- end }} containers: - volumeMounts: {{- toYaml .Values.head.volumeMounts | nindent 12 }} name: ray-head @@ -100,6 +103,9 @@ spec: command: ['sh', '-c', "until nslookup $FQ_RAY_IP; do echo waiting for K8s Service $FQ_RAY_IP; sleep 2; done"] securityContext: {{- toYaml $values.initContainerSecurityContext | nindent 14 }} + {{- if $values.serviceAccountName }} + serviceAccountName: {{ $values.serviceAccountName }} + {{- end }} containers: - volumeMounts: {{- toYaml $values.volumeMounts | nindent 12 }} name: ray-worker @@ -166,6 +172,9 @@ spec: command: ['sh', '-c', "until nslookup $FQ_RAY_IP; do echo waiting for K8s Service $FQ_RAY_IP; sleep 2; done"] securityContext: {{- toYaml .Values.worker.initContainerSecurityContext | nindent 14 }} + {{- if .Values.worker.serviceAccountName }} + serviceAccountName: {{ .Values.worker.serviceAccountName }} + {{- end }} containers: - volumeMounts: {{- toYaml .Values.worker.volumeMounts | nindent 12 }} name: ray-worker diff --git a/helm-chart/ray-cluster/values.yaml b/helm-chart/ray-cluster/values.yaml index 0df6663362..710bda319d 100644 --- a/helm-chart/ray-cluster/values.yaml +++ b/helm-chart/ray-cluster/values.yaml @@ -39,6 +39,7 @@ head: # cpu: "500m" # memory: "512Mi" labels: {} + serviceAccountName: "" rayStartParams: dashboard-host: '0.0.0.0' block: 'true' @@ -98,6 +99,7 @@ worker: groupName: workergroup replicas: 1 labels: {} + serviceAccountName: "" rayStartParams: block: 'true' initContainerImage: 'busybox:1.28' # Enable users to specify the image for init container. Users can pull the busybox image from their private repositories. @@ -161,6 +163,7 @@ additionalWorkerGroups: minReplicas: 1 maxReplicas: 3 labels: {} + serviceAccountName: "" rayStartParams: block: 'true' initContainerImage: 'busybox:1.28' # Enable users to specify the image for init container. Users can pull the busybox image from their private repositories.