apache/celeborn

[BUG] Make volume name dynamic in statefulset in helm chart

a140262 opened this issue · 3 comments

What is the bug(with logs or screenshots)?

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"

How to reproduce the bug?

Helm install Celeborn cluster twice in the same namespace with different release names.
For example:

helm install celeborn charts/celeborn-shuffle-service  -n celeborn
helm install clbv3 charts/celeborn-shuffle-service  -n celeborn

How to fix it?

Update volumeMounts's name by a dynamic {{ $.Release.Name }} prefix .
master-stateful.yaml

initContainers:
      .....
      - name: chown-{{ $.Release.Name }}-master-volume
        .....
        securityContext:
        .....
        command:
        .....
        volumeMounts:
          - name: {{ $.Release.Name }}-master-vol-0
          .....

worker-stateful.yaml

 initContainers:
     .....
      - name: chown-{{ $.Release.Name }}-worker-volume
      .....
        securityContext:
          .....
        command:
         .....
        volumeMounts:
        {{- range $index, $dir := $dirs }}
        - name: {{ $.Release.Name }}-worker-vol-{{ $index }}
           .....

Thanks @a140262 for reporting this bug and how-to-fix, looking forward to your PR :)

Closed via #1901