[bitnami/redis] Reuse certs from existing secrets (#9907)

* Issue #9785 Reuse existing secrets for certs

Signed-off-by: Richard Cunningham <cunningr@cisco.com>

* Bumping Redis chart version

Signed-off-by: Richard Cunningham <cunningr@cisco.com>

Co-authored-by: Richard Cunningham <cunningr@cisco.com>
This commit is contained in:
Richard Cunningham
2022-05-05 08:49:42 +01:00
committed by GitHub
parent 165ed11a96
commit 80b6ced41b
2 changed files with 7 additions and 5 deletions

View File

@@ -24,4 +24,4 @@ maintainers:
name: redis
sources:
- https://github.com/bitnami/bitnami-docker-redis
version: 16.8.9
version: 16.8.10

View File

@@ -1,4 +1,6 @@
{{- if (include "redis.createTlsSecret" .) }}
{{- $secretName := printf "%s-crt" (include "common.names.fullname" .) }}
{{- $existingCerts := (lookup "v1" "Secret" .Release.Namespace $secretName).data | default dict }}
{{- $ca := genCA "redis-ca" 365 }}
{{- $releaseNamespace := .Release.Namespace }}
{{- $clusterDomain := .Values.clusterDomain }}
@@ -10,7 +12,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "common.names.fullname" . }}-crt
name: {{ $secretName }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
@@ -20,7 +22,7 @@ metadata:
{{- end }}
type: kubernetes.io/tls
data:
ca.crt: {{ $ca.Cert | b64enc | quote }}
tls.crt: {{ $crt.Cert | b64enc | quote }}
tls.key: {{ $crt.Key | b64enc | quote }}
ca.crt: {{ (get $existingCerts "ca.crt") | default ($ca.Cert | b64enc | quote ) }}
tls.crt: {{ (get $existingCerts "tls.crt") | default ($crt.Cert | b64enc | quote) }}
tls.key: {{ (get $existingCerts "tls.key") | default ($crt.Key | b64enc | quote) }}
{{- end }}