Parametrize the certificate secret name

This commit is contained in:
Martin Šalata
2021-04-02 22:12:59 +02:00
parent f4c81429e8
commit 265d582df9
5 changed files with 15 additions and 3 deletions

View File

@@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1
version: 0.0.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: v0.0.1-b326755-dirty
appVersion: v0.0.1

View File

@@ -10,6 +10,10 @@ Expand the name of the chart.
ips-injector-svc
{{- end }}
{{- define "imagepullsecret-injector.certificateSecretName" -}}
{{ include "imagepullsecret-injector.name" . }}-webhook-certs
{{- end }}
{{- define "imagepullsecret-injector.lookupCaBundle" -}}
{{- /* Find the name of the secret corresponding to the default SA in the default namespace */ -}}
{{- /* Equivalent to `kubectl get sa -n default default -ojsonpath='{.secrets[0].name}'` */ -}}

View File

@@ -20,6 +20,10 @@ spec:
- name: pre-install-job
image: "{{ .Values.certificateGeneratorImage.registry }}/{{ .Values.certificateGeneratorImage.repository }}:{{ .Values.certificateGeneratorImage.tag | default .Chart.AppVersion }}"
command: ["/entrypoint/entrypoint.sh"]
args:
- --service="{{ include "imagepullsecret-injector.serviceName" . }}"
- --namespace="{{ .Release.Namespace }}"
- --secret="{{ include "imagepullsecret-injector.certificateSecretName" . }}"
volumeMounts:
- mountPath: "/entrypoint"
name: entrypoint

View File

@@ -13,6 +13,10 @@ spec:
- name: pre-install-job
image: "{{ .Values.certificateGeneratorImage.registry }}/{{ .Values.certificateGeneratorImage.repository }}:{{ .Values.certificateGeneratorImage.tag | default .Chart.AppVersion }}"
command: ["/entrypoint/entrypoint.sh"]
args:
- --service="{{ include "imagepullsecret-injector.serviceName" . }}"
- --namespace="{{ .Release.Namespace }}"
- --secret="{{ include "imagepullsecret-injector.certificateSecretName" . }}"
volumeMounts:
- mountPath: "/entrypoint"
name: entrypoint

View File

@@ -49,4 +49,4 @@ spec:
volumes:
- name: webhook-certs
secret:
secretName: imagepullsecret-injector-webhook-certs
secretName: {{ include "imagepullsecret-injector.certificateSecretName" . }}