Skip to content

Commit 2e5ce3c

Browse files
feat(helm): support global image registry and node selectors
1 parent 5f1c2e0 commit 2e5ce3c

15 files changed

+154
-97
lines changed

deploy/helm/fluid/charts/fluid/templates/_helpers.tpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ Create the name of the service account to use
6969
{{- $imageTag := index . 2 -}}
7070
{{- $root := index . 3 -}}
7171

72+
{{- if $root.Values.global.imageRegistry -}}
73+
{{- $imagePrefix = $root.Values.global.imageRegistry -}}
74+
{{- end -}}
75+
7276
{{- /* If any value is empty, return an error message */ -}}
7377
{{- if or (empty $imagePrefix) (empty $imageName) (empty $imageTag) -}}
7478
{{- fail "Error: imagePrefix, imageName, and imageTag must all be defined and non-empty." -}}
@@ -84,6 +88,10 @@ Create the name of the service account to use
8488
{{- $imageTag := index . 2 -}}
8589
{{- $root := index . 3 -}}
8690

91+
{{- if $root.Values.global.imageRegistry -}}
92+
{{- $imagePrefix = $root.Values.global.imageRegistry -}}
93+
{{- end -}}
94+
8795
{{- /* If any value is empty, return an error message */ -}}
8896
{{- if or (empty $imagePrefix) (empty $imageName) (empty $imageTag) -}}
8997
{{- fail "Error: imagePrefix, imageName, and imageTag must all be defined and non-empty." -}}
@@ -161,3 +169,11 @@ Check if feature gate DataflowAffinity is enabled in the featureGates.
161169
{{- end -}}
162170
{{- $found -}}
163171
{{- end -}}
172+
173+
{{- define "common.nodeSelectors" -}}
174+
{{- $selector := default .Values.global.nodeSelector .Values.nodeSelector }}
175+
{{- if $selector }}
176+
nodeSelector:
177+
{{ toYaml $selector | indent 8 }}
178+
{{- end }}
179+
{{- end }}

deploy/helm/fluid/charts/fluid/templates/controller/alluxioruntime_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ spec:
3535
{{ toYaml .Values.runtime.alluxio.tolerations | indent 6}}
3636
{{- end }}
3737
#hostNetwork: true
38+
{{- include "common.nodeSelectors" .}}
3839
containers:
3940
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.alluxio.controller.imagePrefix .Values.runtime.alluxio.controller.imageName .Values.runtime.alluxio.controller.imageTag . ) }}
4041
name: manager

deploy/helm/fluid/charts/fluid/templates/controller/dataset_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
{{ toYaml .Values.dataset.tolerations | indent 6}}
3434
{{- end }}
3535
#hostNetwork: true
36+
{{- include "common.nodeSelectors" .}}
3637
containers:
3738
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.dataset.controller.imagePrefix .Values.dataset.controller.imageName .Values.dataset.controller.imageTag . ) }}
3839
name: manager

deploy/helm/fluid/charts/fluid/templates/controller/efcruntime_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ spec:
3535
{{ toYaml .Values.runtime.efc.tolerations | indent 6 }}
3636
{{- end }}
3737
#hostNetwork: true
38+
{{- include "common.nodeSelectors" .}}
3839
containers:
3940
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.efc.controller.imagePrefix .Values.runtime.efc.controller.imageName .Values.runtime.efc.controller.imageTag . ) }}
4041
imagePullPolicy: {{ .Values.runtime.efc.controller.imagePullPolicy }}

deploy/helm/fluid/charts/fluid/templates/controller/fluidapp_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ spec:
3131
{{ toYaml .Values.fluidapp.tolerations | indent 6 }}
3232
{{- end }}
3333
#hostNetwork: true
34+
{{- include "common.nodeSelectors" .}}
3435
containers:
3536
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.fluidapp.controller.imagePrefix .Values.fluidapp.controller.imageName .Values.fluidapp.controller.imageTag . ) }}
3637
name: manager

deploy/helm/fluid/charts/fluid/templates/controller/goosefsruntime_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ spec:
3535
{{ toYaml .Values.runtime.goosefs.tolerations | indent 6 }}
3636
{{- end }}
3737
#hostNetwork: true
38+
{{- include "common.nodeSelectors" .}}
3839
containers:
3940
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.goosefs.controller.imagePrefix .Values.runtime.goosefs.controller.imageName .Values.runtime.goosefs.controller.imageTag . ) }}
4041
imagePullPolicy: Always

deploy/helm/fluid/charts/fluid/templates/controller/jindoruntime_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
tolerations:
3535
{{ toYaml .Values.runtime.jindo.tolerations | indent 6 }}
3636
{{- end }}
37+
{{- include "common.nodeSelectors" .}}
3738
containers:
3839
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.jindo.controller.imagePrefix .Values.runtime.jindo.controller.imageName .Values.runtime.jindo.controller.imageTag . ) }}
3940
name: manager

deploy/helm/fluid/charts/fluid/templates/controller/juicefsruntime_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ spec:
3535
{{ toYaml .Values.runtime.juicefs.tolerations | indent 6 }}
3636
{{- end }}
3737
#hostNetwork: true
38+
{{- include "common.nodeSelectors" .}}
3839
containers:
3940
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.juicefs.controller.imagePrefix .Values.runtime.juicefs.controller.imageName .Values.runtime.juicefs.controller.imageTag . ) }}
4041
name: manager

deploy/helm/fluid/charts/fluid/templates/controller/thinruntime_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ spec:
3535
{{ toYaml .Values.runtime.thin.tolerations | indent 6 }}
3636
{{- end }}
3737
#hostNetwork: true
38+
{{- include "common.nodeSelectors" .}}
3839
containers:
3940
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.thin.controller.imagePrefix .Values.runtime.thin.controller.imageName .Values.runtime.thin.controller.imageTag . ) }}
4041
name: manager

deploy/helm/fluid/charts/fluid/templates/controller/vineyardruntime_controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
tolerations:
3535
{{ toYaml .Values.runtime.vineyard.tolerations | indent 6 }}
3636
{{- end }}
37+
{{- include "common.nodeSelectors" .}}
3738
containers:
3839
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.vineyard.controller.imagePrefix .Values.runtime.vineyard.controller.imageName .Values.runtime.vineyard.controller.imageTag . ) }}
3940
name: manager

0 commit comments

Comments
 (0)