diff --git a/deploy/helm/templates/deployment.yaml b/deploy/helm/templates/deployment.yaml index e67d5821ea8..671a19c7cf8 100644 --- a/deploy/helm/templates/deployment.yaml +++ b/deploy/helm/templates/deployment.yaml @@ -121,6 +121,8 @@ spec: value: {{ .Values.image.imagePullSecrets | toJson | quote }} - name: KUBEBLOCKS_TOOLS_IMAGE value: "{{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.tools.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + - name: KUBEBLOCKS_IMAGE_REGISTRY + value: "{{ .Values.image.registry | default "docker.io" }}" - name: KUBEBLOCKS_SERVICEACCOUNT_NAME value: {{ include "kubeblocks.serviceAccountName" . }} {{- if .Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1" }} diff --git a/pkg/constant/const.go b/pkg/constant/const.go index 66269fafd23..d0618627e28 100644 --- a/pkg/constant/const.go +++ b/pkg/constant/const.go @@ -31,6 +31,7 @@ const ( KBToolsImage = "KUBEBLOCKS_TOOLS_IMAGE" KBImagePullPolicy = "KUBEBLOCKS_IMAGE_PULL_POLICY" KBImagePullSecrets = "KUBEBLOCKS_IMAGE_PULL_SECRETS" + KBImageRegistry = "KUBEBLOCKS_IMAGE_REGISTRY" ) const ( diff --git a/pkg/controller/instanceset/object_builder.go b/pkg/controller/instanceset/object_builder.go index 6e49fee6ca4..960c942f63d 100644 --- a/pkg/controller/instanceset/object_builder.go +++ b/pkg/controller/instanceset/object_builder.go @@ -254,7 +254,7 @@ func injectCustomRoleProbeContainer(its *workloads.InstanceSet, template *corev1 agentPath := strings.Join([]string{roleAgentVolumeMountPath, roleAgentName}, "/") initContainer := corev1.Container{ Name: roleAgentInstallerName, - Image: shell2httpImage, + Image: strings.Join([]string{viper.GetString(constant.KBImageRegistry), shell2httpImage}, "/"), ImagePullPolicy: corev1.PullIfNotPresent, VolumeMounts: []corev1.VolumeMount{agentVolumeMount}, Command: []string{