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 8dbbebc64 [CELEBORN-1954][HELM] Add a new value image.registry
8dbbebc64 is described below
commit 8dbbebc6440424bbb01f64cd4f383ade34eafdd9
Author: Yi Chen <[email protected]>
AuthorDate: Wed Apr 2 11:02:35 2025 +0800
[CELEBORN-1954][HELM] Add a new value image.registry
### What changes were proposed in this pull request?
Add a new value `image.registry` to `values.yaml`.
### Why are the changes needed?
Add a new value `image.registry` so we can easily switch between different
image registries (e.g. `docker.io`, `ghcr.io`, `quay.io` and private image
registries).
This PR is part of #2654.
### Does this PR introduce _any_ user-facing change?
Yes, but it should be backward-compatible.
### How was this patch tested?
Update helm unit test and run `helm unittest charts/celeborn --file
"tests/**/*_test.yaml" --strict --debug`.
Closes #3187 from ChenYi015/helm/image.
Authored-by: Yi Chen <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
charts/celeborn/templates/_helpers.tpl | 5 ++++-
charts/celeborn/templates/master/statefulset.yaml | 2 +-
charts/celeborn/tests/master/statefulset_test.yaml | 7 ++++---
charts/celeborn/tests/worker/statefulset_test.yaml | 7 ++++---
charts/celeborn/values.yaml | 8 +++++---
5 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/charts/celeborn/templates/_helpers.tpl
b/charts/celeborn/templates/_helpers.tpl
index 58c8a96d8..c24491c6d 100644
--- a/charts/celeborn/templates/_helpers.tpl
+++ b/charts/celeborn/templates/_helpers.tpl
@@ -111,5 +111,8 @@ Create the name of configmap to use
Create the name of the celeborn image to use
*/}}
{{- define "celeborn.image" -}}
-{{ .Values.image.repository }}:{{ .Values.image.tag | default
.Chart.AppVersion }}
+{{- $imageRegistry := .Values.image.registry | default "docker.io" }}
+{{- $imageRepository := .Values.image.repository | default "apache/celeborn" }}
+{{- $imageTag := .Values.image.tag | default .Chart.AppVersion }}
+{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }}
{{- end }}
diff --git a/charts/celeborn/templates/master/statefulset.yaml
b/charts/celeborn/templates/master/statefulset.yaml
index 830b1188d..038affe7d 100644
--- a/charts/celeborn/templates/master/statefulset.yaml
+++ b/charts/celeborn/templates/master/statefulset.yaml
@@ -36,7 +36,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
- serviceAccountName: {{ include "celeborn.serviceAccountName" . }}
+ serviceAccountName: {{ include "celeborn.serviceAccountName" . }}
initContainers:
{{- $dirs := .Values.volumes.master }}
{{- if eq "hostPath" (index $dirs 0).type }}
diff --git a/charts/celeborn/tests/master/statefulset_test.yaml
b/charts/celeborn/tests/master/statefulset_test.yaml
index 3df8a9c35..e8846cae5 100644
--- a/charts/celeborn/tests/master/statefulset_test.yaml
+++ b/charts/celeborn/tests/master/statefulset_test.yaml
@@ -37,15 +37,16 @@ tests:
path: spec.template.metadata.annotations.key2
value: value2
- - it: Should use the specified image if `image.repository` and `image.tag`
is set
+ - it: Should use the specified image if `image.registry`, `image.repository`
and `image.tag` is set
set:
image:
+ registry: test-registry
repository: test-repository
tag: test-tag
asserts:
- equal:
- path: spec.template.spec.containers[0].image
- value: test-repository:test-tag
+ path: spec.template.spec.containers[?(@.name=="celeborn")].image
+ value: test-registry/test-repository:test-tag
- it: Should use the specified image pull policy if `image.pullPolicy` is set
set:
diff --git a/charts/celeborn/tests/worker/statefulset_test.yaml
b/charts/celeborn/tests/worker/statefulset_test.yaml
index 07fc3664e..d9268b0f6 100644
--- a/charts/celeborn/tests/worker/statefulset_test.yaml
+++ b/charts/celeborn/tests/worker/statefulset_test.yaml
@@ -37,15 +37,16 @@ tests:
path: spec.template.metadata.annotations.key2
value: value2
- - it: Should use the specified image if `image.repository` and `image.tag`
is set
+ - it: Should use the specified image if `image.registry`, `image.repository`
and `image.tag` is set
set:
image:
+ registry: test-registry
repository: test-repository
tag: test-tag
asserts:
- equal:
- path: spec.template.spec.containers[0].image
- value: test-repository:test-tag
+ path: spec.template.spec.containers[?(@.name=="celeborn")].image
+ value: test-registry/test-repository:test-tag
- it: Should use the specified image pull policy if `image.pullPolicy` is set
set:
diff --git a/charts/celeborn/values.yaml b/charts/celeborn/values.yaml
index 8847707be..a0d8d8bd6 100644
--- a/charts/celeborn/values.yaml
+++ b/charts/celeborn/values.yaml
@@ -27,10 +27,12 @@ fullnameOverride: ""
# Specifies the Celeborn image to use
image:
+ # -- Image registry
+ registry: docker.io
# -- Image repository
- repository: aliyunemr/remote-shuffle-service
- # -- Image tag
- tag: 0.1.1-6badd20
+ repository: apache/celeborn
+ # -- Image tag, default is chart `appVersion`
+ tag: ""
# -- Image pull policy
pullPolicy: Always
# -- Image name for init containter. (your-private-repo/alpine:3.18)