Skip to content

Commit

Permalink
[kube-state-metrics] Allow parent charts to override registry hostname (
Browse files Browse the repository at this point in the history
#3043)

* Allow parent charts to override registry hostname

Signed-off-by: John Swarbrick <[email protected]>
  • Loading branch information
johnswarbrick-napier authored Feb 20, 2023
1 parent 16dff31 commit c4158de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- prometheus
- kubernetes
type: application
version: 4.30.0
version: 4.31.0
appVersion: 2.8.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
12 changes: 6 additions & 6 deletions charts/kube-state-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ spec:
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.image.sha }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (print "v" .Chart.AppVersion) }}@sha256:{{ .Values.image.sha }}"
image: "{{ .Values.global.imageRegistry | default .Values.image.repository }}:{{ .Values.image.tag | default (print "v" .Chart.AppVersion) }}@sha256:{{ .Values.image.sha }}"
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (print "v" .Chart.AppVersion) }}"
image: "{{ .Values.global.imageRegistry | default .Values.image.repository }}:{{ .Values.image.tag | default (print "v" .Chart.AppVersion) }}"
{{- end }}
{{- if eq .Values.kubeRBACProxy.enabled false }}
ports:
Expand Down Expand Up @@ -168,9 +168,9 @@ spec:
mountPath: /etc/kube-rbac-proxy-config
imagePullPolicy: {{ .Values.kubeRBACProxy.image.pullPolicy }}
{{- if .Values.kubeRBACProxy.image.sha }}
image: "{{ .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}@sha256:{{ .Values.kubeRBACProxy.image.sha }}"
image: "{{ .Values.global.imageRegistry | default .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}@sha256:{{ .Values.kubeRBACProxy.image.sha }}"
{{- else }}
image: "{{ .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}"
image: "{{ .Values.global.imageRegistry | default .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}"
{{- end }}
ports:
- containerPort: {{ .Values.service.port | default 8080}}
Expand Down Expand Up @@ -207,9 +207,9 @@ spec:
mountPath: /etc/kube-rbac-proxy-config
imagePullPolicy: {{ .Values.kubeRBACProxy.image.pullPolicy }}
{{- if .Values.kubeRBACProxy.image.sha }}
image: "{{ .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}@sha256:{{ .Values.kubeRBACProxy.image.sha }}"
image: "{{ .Values.global.imageRegistry | default .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}@sha256:{{ .Values.kubeRBACProxy.image.sha }}"
{{- else }}
image: "{{ .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}"
image: "{{ .Values.global.imageRegistry | default .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}"
{{- end }}
ports:
- containerPort: {{ .Values.selfMonitor.telemetryPort | default 8081 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ global:
# - pullSecret1
# - pullSecret2
imagePullSecrets: []
#
# Allow parent charts to override registry hostname
imageRegistry: ""

# 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
Expand Down

0 comments on commit c4158de

Please sign in to comment.