Skip to content

Commit

Permalink
Merge pull request #243 from Gentleelephant/release-2.5-229
Browse files Browse the repository at this point in the history
update imageRegistry
  • Loading branch information
benjaminhuo authored Feb 29, 2024
2 parents e2801d1 + a6a143c commit 4e93081
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
19 changes: 19 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,22 @@
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}


{{- define "global.imageRegistry" -}}
{{- $registry := default .Values.global.imageRegistry .Values.imageRegistryOverride }}
{{- if $registry -}}
{{- printf "%s/" $registry -}}
{{- end -}}
{{- end -}}


{{- define "common.notificationmanager.nodeSelectors" -}}
{{- $selector := default .Values.global.nodeSelector .Values.notificationmanager.nodeSelector }}
{{- toYaml $selector | nindent 4 }}
{{- end -}}

{{- define "common.operator.nodeSelectors" -}}
{{- $selector := default .Values.global.nodeSelector .Values.operator.nodeSelector }}
{{- toYaml $selector | nindent 8 }}
{{- end -}}
8 changes: 4 additions & 4 deletions helm/templates/notificationmanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ spec:
{{- if .Values.notificationmanager.replicas }}
replicas: {{ .Values.notificationmanager.replicas }}
{{- end}}
image: {{ .Values.notificationmanager.image.repo }}:{{ .Values.notificationmanager.image.tag }}
image: {{ include "global.imageRegistry" .}}{{ .Values.notificationmanager.image.repo }}:{{ .Values.notificationmanager.image.tag }}
imagePullPolicy: {{ .Values.notificationmanager.image.pullPolicy }}
serviceAccountName: notification-manager-sa
portName: webhook
nodeSelector:
{{- toYaml .Values.notificationmanager.nodeSelector | nindent 4 }}
nodeSelector:
{{- include "common.notificationmanager.nodeSelectors" . }}
affinity:
{{- toYaml .Values.notificationmanager.affinity | nindent 4 }}
tolerations:
Expand Down Expand Up @@ -41,7 +41,7 @@ spec:
{{- if .Values.kubesphere.image }}
image: {{ .Values.kubesphere.image }}
{{- else }}
image: kubesphere/notification-tenant-sidecar:{{ .Values.kubesphere.version }}
image: {{ include "global.imageRegistry" . }}{{ .Values.notificationmanager.sidecar.image.repo }}:{{ .Values.kubesphere.version }}
{{- end }}
name: tenant
type: kubesphere
Expand Down
6 changes: 3 additions & 3 deletions helm/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: {{ .Values.operator.containers.proxy.image.repo }}:{{ .Values.operator.containers.proxy.image.tag }}
image: {{ include "global.imageRegistry" . }}{{ .Values.operator.containers.proxy.image.repo }}:{{ .Values.operator.containers.proxy.image.tag }}
imagePullPolicy: {{ .Values.operator.containers.proxy.image.pullPolicy }}
name: kube-rbac-proxy
ports:
Expand All @@ -47,7 +47,7 @@ spec:
- name: TZ
value: {{ .Values.timezone }}
{{- end }}
image: {{ .Values.operator.containers.operator.image.repo }}:{{ .Values.operator.containers.operator.image.tag }}
image: {{ include "global.imageRegistry" . }}{{ .Values.operator.containers.operator.image.repo }}:{{ .Values.operator.containers.operator.image.tag }}
imagePullPolicy: {{ .Values.operator.containers.operator.image.pullPolicy }}
name: notification-manager-operator
ports:
Expand All @@ -68,7 +68,7 @@ spec:
serviceAccount: notification-manager-sa
serviceAccountName: notification-manager-sa
nodeSelector:
{{- toYaml .Values.operator.nodeSelector | nindent 8 }}
{{- include "common.operator.nodeSelectors" . }}
affinity:
{{- toYaml .Values.operator.affinity | nindent 8 }}
tolerations:
Expand Down
7 changes: 7 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ kubesphere:
# supported version: v3.1.0, v3.2.0
version: v3.2.0

global:
imageRegistry: ""
nodeSelector: {}
imageRegistryOverride: ""
# value of notification-manager-operator
operator:
containers:
Expand Down Expand Up @@ -52,6 +56,9 @@ notificationmanager:
repo: kubesphere/notification-manager
tag: v2.5.0-rc.1
pullPolicy: IfNotPresent
sidecar:
image:
repo: kubesphere/notification-tenant-sidecar
replicas: 1
resources:
limits:
Expand Down

0 comments on commit 4e93081

Please sign in to comment.