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

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


The following commit(s) were added to refs/heads/main by this push:
     new 76d861799 [CELEBORN-1981][HELM] Rename masterReplicas and 
workerReplicas to master.replicas and worker.replicas
76d861799 is described below

commit 76d8617999557ddb68ec4a169b570a60f50e2b76
Author: Yi Chen <[email protected]>
AuthorDate: Mon Apr 28 16:34:24 2025 +0800

    [CELEBORN-1981][HELM] Rename masterReplicas and workerReplicas to 
master.replicas and worker.replicas
    
    ### What changes were proposed in this pull request?
    
    - Rename `masterReplicas` to `master.replicas`.
    - Rename `workerReplicas` to `worker.replicas`.
    
    ### Why are the changes needed?
    
    Unify the values naming by prefixing them with `master` or `worker`.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes.
    
    ### How was this patch tested?
    
    `helm unittest charts/celeborn --file "tests/**/*_test.yaml" --strict 
--debug`.
    
    Closes #3227 from ChenYi015/helm/replicas.
    
    Authored-by: Yi Chen <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 charts/celeborn/ci/values.yaml                     | 11 ++++++-----
 charts/celeborn/templates/configmap.yaml           |  9 ++-------
 charts/celeborn/templates/master/service.yaml      |  2 +-
 charts/celeborn/templates/master/statefulset.yaml  |  4 ++--
 charts/celeborn/templates/worker/statefulset.yaml  |  5 +++--
 charts/celeborn/tests/configmap_test.yaml          |  2 --
 charts/celeborn/tests/master/service_test.yaml     |  6 ++++--
 charts/celeborn/tests/master/statefulset_test.yaml | 17 +++++++++--------
 charts/celeborn/tests/worker/statefulset_test.yaml | 16 ++++++++--------
 charts/celeborn/values.yaml                        | 11 ++++++-----
 10 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/charts/celeborn/ci/values.yaml b/charts/celeborn/ci/values.yaml
index 782097b15..86b43b7d4 100644
--- a/charts/celeborn/ci/values.yaml
+++ b/charts/celeborn/ci/values.yaml
@@ -28,11 +28,6 @@ image:
   # -- Image pull policy
   pullPolicy: IfNotPresent
 
-# -- Specifies the number of Celeborn master replicas to deploy
-masterReplicas: 1
-# -- Specifies the number of Celeborn worker replicas to deploy
-workerReplicas: 1
-
 service:
   # -- Specifies service type
   type: ClusterIP
@@ -89,6 +84,9 @@ dnsPolicy: ClusterFirstWithHostNet
 hostNetwork: true
 
 master:
+  # -- Number of Celeborn master replicas to deploy, should not less than 3.
+  replicas: 1
+
   # -- Environment variables for Celeborn master containers.
   env:
   - name: CELEBORN_MASTER_MEMORY
@@ -110,6 +108,9 @@ master:
       memory: 800Mi
 
 worker:
+  # -- Number of Celeborn worker replicas to deploy, should less than node 
number.
+  replicas: 1
+
   # -- Environment variables for Celeborn worker containers.
   env:
   - name: CELEBORN_WORKER_MEMORY
diff --git a/charts/celeborn/templates/configmap.yaml 
b/charts/celeborn/templates/configmap.yaml
index 5ccaa63d0..c389cfc70 100644
--- a/charts/celeborn/templates/configmap.yaml
+++ b/charts/celeborn/templates/configmap.yaml
@@ -24,8 +24,8 @@ metadata:
 data:
   celeborn-defaults.conf: |-
     {{- $namespace := .Release.Namespace }}
-    celeborn.master.endpoints={{ range until (.Values.masterReplicas |int) 
}}{{ $.Release.Name }}-master-{{ . }}.{{ $.Release.Name }}-master-svc.{{ 
$namespace }}.svc.{{ $.Values.cluster.name }}.local,{{ end }}
-    {{- range until (.Values.masterReplicas |int) }}
+    celeborn.master.endpoints={{ range until (.Values.master.replicas |int) 
}}{{ $.Release.Name }}-master-{{ . }}.{{ $.Release.Name }}-master-svc.{{ 
$namespace }}.svc.{{ $.Values.cluster.name }}.local,{{ end }}
+    {{- range until (.Values.master.replicas |int) }}
     celeborn.master.ha.node.{{ . }}.host={{ $.Release.Name }}-master-{{ . 
}}.{{ $.Release.Name }}-master-svc.{{ $namespace }}.svc.{{ 
$.Values.cluster.name }}.local
     {{- end }}
     {{- $dirs := .Values.volumes.master }}
@@ -44,11 +44,6 @@ data:
     {{ $key }}={{ $val }}
     {{- end }}
 
-  celeborn-env.sh: |
-    {{- range $key, $val := .Values.environments }}
-    {{ $key }}="{{ $val }}"
-    {{- end}} 
-
   log4j2.xml: |-
     {{- .Files.Get "files/conf/log4j2.xml" | nindent 4 }}
 
diff --git a/charts/celeborn/templates/master/service.yaml 
b/charts/celeborn/templates/master/service.yaml
index 103c8d965..b3a0069c8 100644
--- a/charts/celeborn/templates/master/service.yaml
+++ b/charts/celeborn/templates/master/service.yaml
@@ -16,7 +16,7 @@ limitations under the License.
 */ -}}
 
 {{ if .Values.additionalNodePortServicePerReplica.enabled }}
-{{ range  $i, $e := until (int .Values.masterReplicas) }}
+{{ range  $i, $e := until (int .Values.master.replicas) }}
 ---
 apiVersion: v1
 kind: Service
diff --git a/charts/celeborn/templates/master/statefulset.yaml 
b/charts/celeborn/templates/master/statefulset.yaml
index 0ec4e4614..72899928f 100644
--- a/charts/celeborn/templates/master/statefulset.yaml
+++ b/charts/celeborn/templates/master/statefulset.yaml
@@ -22,6 +22,7 @@ metadata:
   labels:
     {{- include "celeborn.master.labels" . | nindent 4 }}
 spec:
+  replicas: {{ .Values.master.replicas }}
   serviceName: {{ include "celeborn.master.service.name" . }}
   selector:
     matchLabels:
@@ -72,7 +73,7 @@ spec:
         - -c
         {{- $namespace := .Release.Namespace }}
         - >
-          until {{ range until (.Values.masterReplicas | int) }}
+          until {{ range until (.Values.master.replicas | int) }}
           nslookup {{ include "celeborn.master.statefulSet.name" $ }}-{{ . 
}}.{{ include "celeborn.master.service.name" $ }}.{{ $namespace }}.svc.{{ 
$.Values.cluster.name }}.local &&
           {{- end }}
           true; do
@@ -151,4 +152,3 @@ spec:
         {{- toYaml . | nindent 8 }}
       {{- end }}
       terminationGracePeriodSeconds: 30
-  replicas: {{ .Values.masterReplicas }}
diff --git a/charts/celeborn/templates/worker/statefulset.yaml 
b/charts/celeborn/templates/worker/statefulset.yaml
index 9bab89751..baaba6d08 100644
--- a/charts/celeborn/templates/worker/statefulset.yaml
+++ b/charts/celeborn/templates/worker/statefulset.yaml
@@ -22,6 +22,7 @@ metadata:
   labels:
     {{- include "celeborn.worker.labels" . | nindent 4 }}
 spec:
+  replicas: {{ .Values.worker.replicas }}
   serviceName: {{ include "celeborn.worker.service.name" . }}
   selector:
     matchLabels:
@@ -76,7 +77,7 @@ spec:
         - -c
         {{- $namespace := .Release.Namespace }}
         - >
-          until {{ range until (.Values.masterReplicas | int) }}
+          until {{ range until (.Values.master.replicas | int) }}
           nslookup {{ include "celeborn.master.statefulSet.name" $ }}-{{ . 
}}.{{ include "celeborn.master.service.name" $ }}.{{ $namespace }}.svc.{{ 
$.Values.cluster.name }}.local && 
           {{- end }}
           true; do
@@ -154,4 +155,4 @@ spec:
         {{- toYaml . | nindent 8 }}
       {{- end }}
       terminationGracePeriodSeconds: 30
-  replicas: {{ .Values.workerReplicas }}
+  
diff --git a/charts/celeborn/tests/configmap_test.yaml 
b/charts/celeborn/tests/configmap_test.yaml
index 2a9fa6c12..25ed0f48f 100644
--- a/charts/celeborn/tests/configmap_test.yaml
+++ b/charts/celeborn/tests/configmap_test.yaml
@@ -35,7 +35,5 @@ tests:
     asserts:
       - exists:
           path: data["celeborn-defaults.conf"]
-      - exists:
-          path: data["celeborn-env.sh"]
       - exists:
           path: data["log4j2.xml"]
diff --git a/charts/celeborn/tests/master/service_test.yaml 
b/charts/celeborn/tests/master/service_test.yaml
index 49fba72de..a3f660b63 100644
--- a/charts/celeborn/tests/master/service_test.yaml
+++ b/charts/celeborn/tests/master/service_test.yaml
@@ -52,9 +52,11 @@ tests:
       - equal:
           path: spec.ports[0].targetPort
           value: 9097
+
   - it: Should create NodePort service for each master replica
     set:
-      masterReplicas: 3
+      master:
+        replicas: 3
       additionalNodePortServicePerReplica:
         enabled: true
         port: 9097
@@ -77,4 +79,4 @@ tests:
           value: celeborn-master-svc-2
         equal:
           path: spec.ports[0].nodePort
-          value: 30102
\ No newline at end of file
+          value: 30102
diff --git a/charts/celeborn/tests/master/statefulset_test.yaml 
b/charts/celeborn/tests/master/statefulset_test.yaml
index 7d09af67e..c918213fb 100644
--- a/charts/celeborn/tests/master/statefulset_test.yaml
+++ b/charts/celeborn/tests/master/statefulset_test.yaml
@@ -58,6 +58,15 @@ tests:
           path: spec.template.spec.containers[0].imagePullPolicy
           value: Always
 
+  - it: Should use the specified replicas if `master.replicas` is set
+    set:
+      master:
+        replicas: 10
+    asserts:
+      - equal:
+          path: spec.replicas
+          value: 10
+
   - it: Should add environment variables if `master.env` is set
     set:
       master:
@@ -289,11 +298,3 @@ tests:
       - equal:
           path: spec.template.spec.securityContext.fsGroup
           value: 3000
-
-  - it: Should use the specified replicas if `masterReplicas` is set
-    set:
-      masterReplicas: 10
-    asserts:
-      - equal:
-          path: spec.replicas
-          value: 10
diff --git a/charts/celeborn/tests/worker/statefulset_test.yaml 
b/charts/celeborn/tests/worker/statefulset_test.yaml
index ba2f63a50..cf7a70b66 100644
--- a/charts/celeborn/tests/worker/statefulset_test.yaml
+++ b/charts/celeborn/tests/worker/statefulset_test.yaml
@@ -58,6 +58,14 @@ tests:
           path: spec.template.spec.containers[0].imagePullPolicy
           value: Always
 
+  - it: Should use the specified replicas if `worker.replicas` is set
+    set:
+      worker.replicas: 10
+    asserts:
+      - equal:
+          path: spec.replicas
+          value: 10
+
   - it: Should add environment variables if `worker.env` is set
     set:
       worker:
@@ -289,11 +297,3 @@ tests:
       - equal:
           path: spec.template.spec.securityContext.fsGroup
           value: 3000
-
-  - it: Should use the specified replicas if `workerReplicas` is set
-    set:
-      workerReplicas: 10
-    asserts:
-      - equal:
-          path: spec.replicas
-          value: 10
diff --git a/charts/celeborn/values.yaml b/charts/celeborn/values.yaml
index 9733be018..d69d680b6 100644
--- a/charts/celeborn/values.yaml
+++ b/charts/celeborn/values.yaml
@@ -41,11 +41,6 @@ image:
 # -- Image pull secrets for private image registry
 imagePullSecrets: []
 
-# -- Specifies the number of Celeborn master replicas to deploy, master 
replicas should not less than 3
-masterReplicas: 3
-# -- Specifies the number of Celeborn worker replicas to deploy, should less 
than node number
-workerReplicas: 5
-
 service:
   # -- Specifies service type
   type: ClusterIP
@@ -139,6 +134,9 @@ securityContext:
   fsGroup: 10006
 
 master:
+  # -- Number of Celeborn master replicas to deploy, should not less than 3.
+  replicas: 3
+
   # -- Annotations for Celeborn master pods.
   annotations:
     # key1: value1
@@ -214,6 +212,9 @@ master:
     value: 1000000000
 
 worker:
+  # -- Number of Celeborn worker replicas to deploy, should less than node 
number.
+  replicas: 5
+
   # -- Annotations for Celeborn worker pods.
   annotations:
     # key1: value1

Reply via email to