Skip to content

Commit

Permalink
Chart: Add global.image.registry.
Browse files Browse the repository at this point in the history
  • Loading branch information
amarkevich committed Dec 8, 2024
1 parent 0b1bca6 commit 2a4c823
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 66 deletions.
27 changes: 14 additions & 13 deletions charts/secrets-store-csi-driver/README.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions charts/secrets-store-csi-driver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,13 @@ Return the appropriate apiVersion for CSIDriver.
{{- print "storage.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}

{{- define "sscd.imageRepository" -}}
{{- $globalImageRegistry := index . 0 -}}
{{- $repository := index . 1 -}}
{{- if hasPrefix "/" $repository -}}
{{ $globalImageRegistry }}{{ $repository }}
{{- else -}}
{{ $repository }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spec:
restartPolicy: Never
containers:
- name: crds-upgrade
image: "{{ .Values.linux.crds.image.repository }}:{{ .Values.linux.crds.image.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.crds.image.repository) }}:{{ .Values.linux.crds.image.tag }}"
args:
- apply
- -f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spec:
restartPolicy: Never
containers:
- name: crds-keep
image: "{{ .Values.linux.crds.image.repository }}:{{ .Values.linux.crds.image.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.crds.image.repository) }}:{{ .Values.linux.crds.image.tag }}"
args:
- patch
- crd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ spec:
containers:
- name: node-driver-registrar
{{- if .Values.windows.registrarImage.digest }}
image: "{{ .Values.windows.registrarImage.repository }}@{{ .Values.windows.registrarImage.digest }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.windows.registrarImage.repository) }}@{{ .Values.windows.registrarImage.digest }}"
{{- else }}
image: "{{ .Values.windows.registrarImage.repository }}:{{ .Values.windows.registrarImage.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.windows.registrarImage.repository) }}:{{ .Values.windows.registrarImage.tag }}"
{{- end }}
args:
- --v={{ .Values.windows.registrar.logVerbosity }}
Expand All @@ -59,9 +59,9 @@ spec:
{{- end }}
- name: secrets-store
{{- if .Values.windows.image.digest }}
image: "{{ .Values.windows.image.repository }}@{{ .Values.windows.image.digest }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.windows.image.repository) }}@{{ .Values.windows.image.digest }}"
{{- else }}
image: "{{ .Values.windows.image.repository }}:{{ .Values.windows.image.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.windows.image.repository) }}:{{ .Values.windows.image.tag }}"
{{- end }}
args:
{{- if .Values.logVerbosity }}
Expand Down Expand Up @@ -140,9 +140,9 @@ spec:
{{- end }}
- name: liveness-probe
{{- if .Values.windows.livenessProbeImage.digest }}
image: "{{ .Values.windows.livenessProbeImage.repository }}@{{ .Values.windows.livenessProbeImage.digest }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.windows.livenessProbeImage.repository) }}@{{ .Values.windows.livenessProbeImage.digest }}"
{{- else }}
image: "{{ .Values.windows.livenessProbeImage.repository }}:{{ .Values.windows.livenessProbeImage.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.windows.livenessProbeImage.repository) }}:{{ .Values.windows.livenessProbeImage.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.windows.livenessProbeImage.pullPolicy }}
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ spec:
containers:
- name: node-driver-registrar
{{- if .Values.linux.registrarImage.digest }}
image: "{{ .Values.linux.registrarImage.repository }}@{{ .Values.linux.registrarImage.digest }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.registrarImage.repository) }}@{{ .Values.linux.registrarImage.digest }}"
{{- else }}
image: "{{ .Values.linux.registrarImage.repository }}:{{ .Values.linux.registrarImage.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.registrarImage.repository) }}:{{ .Values.linux.registrarImage.tag }}"
{{- end }}
args:
- --v={{ .Values.linux.registrar.logVerbosity }}
Expand All @@ -59,9 +59,9 @@ spec:
{{- end }}
- name: secrets-store
{{- if .Values.linux.image.digest }}
image: "{{ .Values.linux.image.repository }}@{{ .Values.linux.image.digest }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.image.repository) }}@{{ .Values.linux.image.digest }}"
{{- else }}
image: "{{ .Values.linux.image.repository }}:{{ .Values.linux.image.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.image.repository) }}:{{ .Values.linux.image.tag }}"
{{- end }}
args:
{{- if .Values.logVerbosity }}
Expand Down Expand Up @@ -143,9 +143,9 @@ spec:
{{- end }}
- name: liveness-probe
{{- if .Values.linux.livenessProbeImage.digest }}
image: "{{ .Values.linux.livenessProbeImage.repository }}@{{ .Values.linux.livenessProbeImage.digest }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.livenessProbeImage.repository) }}@{{ .Values.linux.livenessProbeImage.digest }}"
{{- else }}
image: "{{ .Values.linux.livenessProbeImage.repository }}:{{ .Values.linux.livenessProbeImage.tag }}"
image: "{{ include "sscd.imageRepository" (list .Values.global.image.registry .Values.linux.livenessProbeImage.repository) }}:{{ .Values.linux.livenessProbeImage.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.linux.livenessProbeImage.pullPolicy }}
args:
Expand Down
21 changes: 15 additions & 6 deletions charts/secrets-store-csi-driver/values.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
global:
image:
registry: registry.k8s.io

linux:
enabled: true
image:
repository: registry.k8s.io/csi-secrets-store/driver
repository: /csi-secrets-store/driver
tag: v1.4.7
#digest: sha256:
pullPolicy: IfNotPresent

crds:
enabled: true
image:
repository: registry.k8s.io/csi-secrets-store/driver-crds
repository: /csi-secrets-store/driver-crds
tag: v1.4.7
pullPolicy: IfNotPresent
## Optionally override resource limits for crd hooks(jobs)
Expand Down Expand Up @@ -44,7 +48,7 @@ linux:
memory: 100Mi

registrarImage:
repository: registry.k8s.io/sig-storage/csi-node-driver-registrar
repository: /sig-storage/csi-node-driver-registrar
tag: v2.11.1
#digest: sha256:
pullPolicy: IfNotPresent
Expand All @@ -60,7 +64,7 @@ linux:
logVerbosity: 5

livenessProbeImage:
repository: registry.k8s.io/sig-storage/livenessprobe
repository: /sig-storage/livenessprobe
tag: v2.13.1
#digest: sha256:
pullPolicy: IfNotPresent
Expand Down Expand Up @@ -109,8 +113,13 @@ linux:
windows:
enabled: false
image:
<<<<<<< Upstream, based on kubernetes-sigs/main
repository: registry.k8s.io/csi-secrets-store/driver
tag: v1.4.7
=======
repository: /csi-secrets-store/driver
tag: v1.4.6
>>>>>>> d50e17b Chart: Add global.image.registry.
#digest: sha256:
pullPolicy: IfNotPresent

Expand All @@ -135,7 +144,7 @@ windows:
memory: 100Mi

registrarImage:
repository: registry.k8s.io/sig-storage/csi-node-driver-registrar
repository: /sig-storage/csi-node-driver-registrar
tag: v2.11.1
#digest: sha256:
pullPolicy: IfNotPresent
Expand All @@ -151,7 +160,7 @@ windows:
logVerbosity: 5

livenessProbeImage:
repository: registry.k8s.io/sig-storage/livenessprobe
repository: /sig-storage/livenessprobe
tag: v2.13.1
#digest: sha256:
pullPolicy: IfNotPresent
Expand Down
Loading

0 comments on commit 2a4c823

Please sign in to comment.