mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
override images in helm chart (#771)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
This commit is contained in:
@@ -13,11 +13,52 @@
|
||||
|
||||
|
||||
|
||||
{{/* Define the image tag. */}}
|
||||
{{- define "imageTag" }}
|
||||
{{- if .Values.images.tag }}
|
||||
{{- printf "%s" .Values.images.tag }}
|
||||
{{- define "registrationImage" }}
|
||||
{{- if .Values.images.overrides.registrationImage }}
|
||||
{{- printf "%s" .Values.images.overrides.registrationImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/registration:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Chart.AppVersion }}
|
||||
{{- printf "%s/registration:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "workImage" }}
|
||||
{{- if .Values.images.overrides.workImage }}
|
||||
{{- printf "%s" .Values.images.overrides.workImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/work:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s/work:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "addOnManagerImage" }}
|
||||
{{- if .Values.images.overrides.addOnManagerImage }}
|
||||
{{- printf "%s" .Values.images.overrides.addOnManagerImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/addon-manager:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s/addon-manager:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "placementImage" }}
|
||||
{{- if .Values.images.overrides.placementImage }}
|
||||
{{- printf "%s" .Values.images.overrides.placementImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/placement:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s/placement:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "operatorImage" }}
|
||||
{{- if .Values.images.overrides.operatorImage }}
|
||||
{{- printf "%s" .Values.images.overrides.operatorImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/registration-operator:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s/registration-operator:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -4,10 +4,10 @@ kind: ClusterManager
|
||||
metadata:
|
||||
name: cluster-manager
|
||||
spec:
|
||||
registrationImagePullSpec: {{ .Values.images.registry }}/registration:{{ template "imageTag" . }}
|
||||
workImagePullSpec: {{ .Values.images.registry }}/work:{{ template "imageTag" . }}
|
||||
placementImagePullSpec: {{ .Values.images.registry }}/placement:{{ template "imageTag" . }}
|
||||
addOnManagerImagePullSpec: {{ .Values.images.registry }}/addon-manager:{{ template "imageTag" . }}
|
||||
registrationImagePullSpec: "{{ template "registrationImage" . }}"
|
||||
workImagePullSpec: "{{ template "workImage" . }}"
|
||||
placementImagePullSpec: "{{ template "placementImage" . }}"
|
||||
addOnManagerImagePullSpec: "{{ template "addOnManagerImage" . }}"
|
||||
deployOption:
|
||||
mode: {{ .Values.clusterManager.mode }}
|
||||
{{- with .Values.clusterManager.resourceRequirement }}
|
||||
|
||||
@@ -32,7 +32,7 @@ spec:
|
||||
serviceAccountName: cluster-manager
|
||||
containers:
|
||||
- name: registration-operator
|
||||
image: "{{ .Values.images.registry }}/registration-operator:{{ template "imageTag" . }}"
|
||||
image: "{{ template "operatorImage" . }}"
|
||||
imagePullPolicy: {{ .Values.images.imagePullPolicy }}
|
||||
args:
|
||||
- "/registration-operator"
|
||||
|
||||
@@ -4,6 +4,14 @@ replicaCount: 3
|
||||
|
||||
# image configurations for all images used in operator deployment and clusterManager CR.
|
||||
images:
|
||||
# the overrides can replace the corresponding image if not empty.
|
||||
overrides:
|
||||
registrationImage: ""
|
||||
workImage: ""
|
||||
placementImage: ""
|
||||
addOnManagerImage: ""
|
||||
operatorImage: ""
|
||||
# registry and tag work on all images, but the image will be replaced by overrides if the image in overrides is not empty.
|
||||
# The registry name must NOT contain a trailing slash.
|
||||
registry: quay.io/open-cluster-management
|
||||
# The image tag is the appVersion by default, can be replaced by this version.
|
||||
@@ -11,6 +19,8 @@ images:
|
||||
imagePullPolicy: IfNotPresent
|
||||
# The image pull secret name is open-cluster-management-image-pull-credentials.
|
||||
# Please set the userName/password or the dockerConfigJson if you use a private image registry.
|
||||
# The registry will be set in the generated credential if you set userName/password.
|
||||
# Suggest to use dockerConfigJson if you set overrides here.
|
||||
# The image pull secret is fixed into the serviceAccount, you can also set
|
||||
# `createImageCredentials` to `false` and create the pull secret manually.
|
||||
imageCredentials:
|
||||
|
||||
@@ -14,11 +14,32 @@ Create secret to access docker registry
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/* Define the image tag. */}}
|
||||
{{- define "imageTag" }}
|
||||
{{- if .Values.images.tag }}
|
||||
{{- printf "%s" .Values.images.tag }}
|
||||
{{- define "registrationImage" }}
|
||||
{{- if .Values.images.overrides.registrationImage }}
|
||||
{{- printf "%s" .Values.images.overrides.registrationImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/registration:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Chart.AppVersion }}
|
||||
{{- printf "%s/registration:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "workImage" }}
|
||||
{{- if .Values.images.overrides.workImage }}
|
||||
{{- printf "%s" .Values.images.overrides.workImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/work:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s/work:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "operatorImage" }}
|
||||
{{- if .Values.images.overrides.operatorImage }}
|
||||
{{- printf "%s" .Values.images.overrides.operatorImage }}
|
||||
{{- else if .Values.images.tag }}
|
||||
{{- printf "%s/registration-operator:%s" .Values.images.registry .Values.images.tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s/registration-operator:%s" .Values.images.registry .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -10,9 +10,9 @@ metadata:
|
||||
spec:
|
||||
deployOption:
|
||||
mode: {{ .Values.klusterlet.mode | default "Singleton" }}
|
||||
registrationImagePullSpec: "{{ .Values.images.registry }}/registration:{{ template "imageTag" . }}"
|
||||
workImagePullSpec: "{{ .Values.images.registry }}/work:{{ template "imageTag" . }}"
|
||||
imagePullSpec: "{{ .Values.images.registry }}/registration-operator:{{ template "imageTag" . }}"
|
||||
registrationImagePullSpec: "{{ template "registrationImage" . }}"
|
||||
workImagePullSpec: "{{ template "workImage" . }}"
|
||||
imagePullSpec: "{{ template "operatorImage" . }}"
|
||||
clusterName: {{ .Values.klusterlet.clusterName }}
|
||||
{{- if or ( eq .Values.klusterlet.mode "Hosted") (eq .Values.klusterlet.mode "SingletonHosted") }}
|
||||
namespace: "open-cluster-management-{{ .Values.klusterlet.clusterName }}"
|
||||
|
||||
@@ -35,7 +35,7 @@ spec:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: klusterlet
|
||||
image: "{{ .Values.images.registry }}/registration-operator:{{ template "imageTag" . }}"
|
||||
image: "{{ template "operatorImage" . }}"
|
||||
imagePullPolicy: {{ .Values.images.imagePullPolicy }}
|
||||
args:
|
||||
- "/registration-operator"
|
||||
|
||||
@@ -3,6 +3,12 @@ replicaCount: 3
|
||||
|
||||
# image configurations for all images used in operator deployment and klusterlet CR.
|
||||
images:
|
||||
# the overrides can replace the corresponding image if not empty.
|
||||
overrides:
|
||||
registrationImage: ""
|
||||
workImage: ""
|
||||
operatorImage: ""
|
||||
# registry and tag work on all images, but the image will be replaced by overrides if the image in overrides is not empty.
|
||||
# The registry name must NOT contain a trailing slash.
|
||||
registry: quay.io/open-cluster-management
|
||||
# The image tag is the appVersion by default, can be replaced by this version.
|
||||
@@ -10,6 +16,8 @@ images:
|
||||
imagePullPolicy: IfNotPresent
|
||||
# The image pull secret name is open-cluster-management-image-pull-credentials.
|
||||
# Please set the userName/password or the dockerConfigJson if you use a private image registry.
|
||||
# The registry will be set in the generated credential if you set userName/password.
|
||||
# Suggest to use dockerConfigJson if you set overrides here.
|
||||
# The image pull secret is fixed into the serviceAccount, you can also set
|
||||
# `createImageCredentials` to `false` and create the pull secret manually.
|
||||
imageCredentials:
|
||||
|
||||
Reference in New Issue
Block a user