You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by re...@apache.org on 2023/06/01 02:34:29 UTC

[incubator-celeborn] branch main updated: [CELEBORN-612][HELM] Tackle hostPath directory permission (#1521)

This is an automated email from the ASF dual-hosted git repository.

rexxiong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new b785c7c56 [CELEBORN-612][HELM] Tackle hostPath directory permission (#1521)
b785c7c56 is described below

commit b785c7c56549a2c75f10dcd504cbec74ad77d3d1
Author: Binjie Yang <52...@users.noreply.github.com>
AuthorDate: Thu Jun 1 10:34:25 2023 +0800

    [CELEBORN-612][HELM] Tackle hostPath directory permission (#1521)
---
 charts/celeborn/templates/configmap.yaml          |  2 +-
 charts/celeborn/templates/master-statefulset.yaml | 16 ++++++++++++++++
 charts/celeborn/templates/worker-statefulset.yaml | 20 ++++++++++++++++++++
 charts/celeborn/values.yaml                       |  2 ++
 4 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/charts/celeborn/templates/configmap.yaml b/charts/celeborn/templates/configmap.yaml
index bd4d1ae9d..941b5d88e 100644
--- a/charts/celeborn/templates/configmap.yaml
+++ b/charts/celeborn/templates/configmap.yaml
@@ -34,7 +34,7 @@ data:
     celeborn.ha.master.node.{{ . }}.host=celeborn-master-{{ . }}.celeborn-master-svc.{{ $namespace }}.svc.{{ $.Values.cluster.name }}.local
     {{- end }}
     {{- $dirs := .Values.volumes.master }}
-    celeborn.ha.master.ratis.raft.server.storage.dir={{ (index $dirs 0).path }}/master
+    celeborn.ha.master.ratis.raft.server.storage.dir={{ (index $dirs 0).path }}
     {{- $path := "" }}
     {{- range $worker := .Values.volumes.worker }}
     {{- if eq $path "" }}
diff --git a/charts/celeborn/templates/master-statefulset.yaml b/charts/celeborn/templates/master-statefulset.yaml
index ed0b8daf2..302d34a91 100644
--- a/charts/celeborn/templates/master-statefulset.yaml
+++ b/charts/celeborn/templates/master-statefulset.yaml
@@ -71,6 +71,22 @@ spec:
       securityContext:
         {{- toYaml . | nindent 8 }}
       {{- end }}
+      initContainers:
+      {{- $dirs := .Values.volumes.master }}
+      {{- if eq "hostPath" (index $dirs 0).type }}
+      - name: chown-celeborn-master-volume
+        image: alpine:3.18
+        imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }}
+        securityContext:
+          runAsUser: 0
+        command:
+        - chown
+        - {{ .Values.securityContext.runAsUser | default 10006 }}:{{ .Values.securityContext.runAsGroup | default 10006 }}
+        - {{ (index $dirs 0).path }}
+        volumeMounts:
+          - name: celeborn-master-vol-0
+            mountPath: {{ (index $dirs 0).path }}
+      {{- end }}
       containers:
       - name: {{ .Chart.Name }}
         image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
diff --git a/charts/celeborn/templates/worker-statefulset.yaml b/charts/celeborn/templates/worker-statefulset.yaml
index 463939ea5..1b8347a25 100644
--- a/charts/celeborn/templates/worker-statefulset.yaml
+++ b/charts/celeborn/templates/worker-statefulset.yaml
@@ -71,6 +71,26 @@ spec:
       securityContext:
         {{- toYaml . | nindent 8 }}
       {{- end }}
+      initContainers:
+      {{- $dirs := .Values.volumes.worker }}
+      {{- if eq "hostPath" (index $dirs 0).type }}
+      - name: chown-celeborn-worker-volume
+        image: alpine:3.18
+        imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }}
+        securityContext:
+          runAsUser: 0
+        command:
+        - chown
+        - {{ .Values.securityContext.runAsUser | default 10006 }}:{{ .Values.securityContext.runAsGroup | default 10006 }}
+        {{- range $dir := $dirs }}
+        - {{ $dir.path }}
+        {{- end}}
+        volumeMounts:
+        {{- range $index, $dir := $dirs }}
+        - name: celeborn-worker-vol-{{ $index }}
+          mountPath: {{ $dir.path }}
+        {{- end}}
+      {{- end }}
       containers:
       - name: {{ .Chart.Name }}
         image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
diff --git a/charts/celeborn/values.yaml b/charts/celeborn/values.yaml
index 3149e70de..4074c6224 100644
--- a/charts/celeborn/values.yaml
+++ b/charts/celeborn/values.yaml
@@ -34,6 +34,8 @@ masterReplicas: 3
 workerReplicas: 5
 
 securityContext:
+  runAsUser: 10006
+  runAsGroup: 10006
   fsGroup: 10006
 
 # Current Celeborn support followings volume type: