diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4e2f08701a09..d4bb11fd9173 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -8,7 +8,7 @@ keywords: - kubernetes type: application version: 5.19.0 -appVersion: 2.12.0 +appVersion: 2.13.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/templates/_helpers.tpl b/charts/kube-state-metrics/templates/_helpers.tpl index a4358c87a106..17b4b27ffbf2 100644 --- a/charts/kube-state-metrics/templates/_helpers.tpl +++ b/charts/kube-state-metrics/templates/_helpers.tpl @@ -121,18 +121,11 @@ Formats imagePullSecrets. Input is (dict "Values" .Values "imagePullSecrets" .{s The image to use for kube-state-metrics */}} {{- define "kube-state-metrics.image" -}} +{{- $registry := index .Values.global.imageRegistries .Values.image.registry | default .Values.global.imageRegistry | default .Values.image.registry -}} {{- if .Values.image.sha }} -{{- if .Values.global.imageRegistry }} -{{- printf "%s/%s:%s@%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.sha }} +{{- printf "%s/%s:%s@%s" $registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.sha }} {{- else }} -{{- printf "%s/%s:%s@%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.sha }} -{{- end }} -{{- else }} -{{- if .Values.global.imageRegistry }} -{{- printf "%s/%s:%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }} -{{- else }} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }} -{{- end }} +{{- printf "%s/%s:%s" $registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }} {{- end }} {{- end }} @@ -140,17 +133,10 @@ The image to use for kube-state-metrics The image to use for kubeRBACProxy */}} {{- define "kubeRBACProxy.image" -}} +{{- $registry := index .Values.global.imageRegistries .Values.kubeRBACProxy.image.registry | default .Values.global.imageRegistry | default .Values.kubeRBACProxy.image.registry -}} {{- if .Values.kubeRBACProxy.image.sha }} -{{- if .Values.global.imageRegistry }} -{{- printf "%s/%s:%s@%s" .Values.global.imageRegistry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) .Values.kubeRBACProxy.image.sha }} +{{- printf "%s/%s:%s@%s" $registry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) .Values.kubeRBACProxy.image.sha }} {{- else }} -{{- printf "%s/%s:%s@%s" .Values.kubeRBACProxy.image.registry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) .Values.kubeRBACProxy.image.sha }} -{{- end }} -{{- else }} -{{- if .Values.global.imageRegistry }} -{{- printf "%s/%s:%s" .Values.global.imageRegistry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) }} -{{- else }} -{{- printf "%s/%s:%s" .Values.kubeRBACProxy.image.registry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) }} -{{- end }} +{{- printf "%s/%s:%s" $registry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) }} {{- end }} {{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 2e8283a89469..605d575c18db 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -27,6 +27,10 @@ global: # # Allow parent charts to override registry hostname imageRegistry: "" + # Allow parent charts to override registries hostname + imageRegistries: {} + # registry.k8s.io: "registry.example.com/k8s" + # quay.io: "registry.example.com/quay" # If set to true, this will deploy kube-state-metrics as a StatefulSet and the data # will be automatically sharded across <.Values.replicas> pods using the built-in