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

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


The following commit(s) were added to refs/heads/branch-0.3 by this push:
     new d71cfa957 [CELEBORN-968] Make volume name dynamic in StatefulSet in 
Helm chart
d71cfa957 is described below

commit d71cfa957bede9e21838d9f00acfd5ba7b58566d
Author: Melody <[email protected]>
AuthorDate: Wed Sep 13 13:45:25 2023 +0800

    [CELEBORN-968] Make volume name dynamic in StatefulSet in Helm chart
    
    ### What changes were proposed in this pull request?
    Update volumeMounts's name by a dynamic {{ $.Release.Name }} prefix  in 
`master-stateful.yaml` and `worker-stateful.yaml`
    
    ### Why are the changes needed?
    
    When running multiple Celeborn clusters with different release names and 
Celeborn versions, helm install was failed until making the initContainers' 
volume name dynamic. See the error from master's statefulset :
    
    >> kubectl describe statefulset.apps/clbv3-master  -n celeborn
    
    Events:
      Type     Reason        Age                From                    Message
      ----     ------        ----               ----                    -------
      Warning  FailedCreate  5s (x14 over 46s)  statefulset-controller  create 
Pod clbv3-master-0 in StatefulSet clbv3-master failed error: Pod 
"clbv3-master-0" is invalid: spec.initContainers[0].volumeMounts[0].name: Not 
found: "celeborn-master-vol-0"
    
    ### Does this PR introduce _any_ user-facing change?
    no
    
    ### How was this patch tested?
    Helm install Celeborn cluster twice in the same namespace but different 
release names. It shouldn't fail.
    For example:
    ```
    helm install celeborn charts/celeborn-shuffle-service  -n celeborn
    helm install clbv3 charts/celeborn-shuffle-service  -n celeborn
    ```
    
    Closes #1901 from a140262/main.
    
    Authored-by: Melody <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit 0bf42013f0c5b530e040f19a1c1305af5fd04c7a)
    Signed-off-by: Cheng Pan <[email protected]>
---
 charts/celeborn/templates/master-statefulset.yaml | 4 ++--
 charts/celeborn/templates/worker-statefulset.yaml | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/charts/celeborn/templates/master-statefulset.yaml 
b/charts/celeborn/templates/master-statefulset.yaml
index 37cfff96d..7b83aab67 100644
--- a/charts/celeborn/templates/master-statefulset.yaml
+++ b/charts/celeborn/templates/master-statefulset.yaml
@@ -76,7 +76,7 @@ spec:
       initContainers:
       {{- $dirs := .Values.volumes.master }}
       {{- if eq "hostPath" (index $dirs 0).type }}
-      - name: chown-celeborn-master-volume
+      - name: chown-{{ $.Release.Name }}-master-volume
         image: alpine:3.18
         imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" 
}}
         securityContext:
@@ -86,7 +86,7 @@ spec:
         - {{ .Values.securityContext.runAsUser | default 10006 }}:{{ 
.Values.securityContext.runAsGroup | default 10006 }}
         - {{ (index $dirs 0).mountPath }}
         volumeMounts:
-          - name: celeborn-master-vol-0
+          - name: {{ $.Release.Name }}-master-vol-0
             mountPath: {{ (index $dirs 0).mountPath }}
       {{- end }}
       containers:
diff --git a/charts/celeborn/templates/worker-statefulset.yaml 
b/charts/celeborn/templates/worker-statefulset.yaml
index 05f649860..7b9f0ad53 100644
--- a/charts/celeborn/templates/worker-statefulset.yaml
+++ b/charts/celeborn/templates/worker-statefulset.yaml
@@ -76,7 +76,7 @@ spec:
       initContainers:
       {{- $dirs := .Values.volumes.worker }}
       {{- if eq "hostPath" (index $dirs 0).type }}
-      - name: chown-celeborn-worker-volume
+      - name: chown-{{ $.Release.Name }}-worker-volume
         image: alpine:3.18
         imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" 
}}
         securityContext:
@@ -89,7 +89,7 @@ spec:
         {{- end}}
         volumeMounts:
         {{- range $index, $dir := $dirs }}
-        - name: celeborn-worker-vol-{{ $index }}
+        - name: {{ $.Release.Name }}-worker-vol-{{ $index }}
           mountPath: {{ $dir.mountPath }}
         {{- end}}
       {{- end }}

Reply via email to