mirror of
https://github.com/bitnami/charts.git
synced 2026-03-16 06:47:30 +08:00
[bitnami/redis] checksum only data part of ConfigMap/Secret (#17579)
Signed-off-by: Cyril Jouve <jv.cyril@gmail.com> Signed-off-by: Miguel Ruiz <miruiz@vmware.com> Co-authored-by: Miguel Ruiz <miruiz@vmware.com>
This commit is contained in:
@@ -25,4 +25,4 @@ maintainers:
|
||||
name: redis
|
||||
sources:
|
||||
- https://github.com/bitnami/charts/tree/main/bitnami/redis
|
||||
version: 17.14.6
|
||||
version: 17.15.0
|
||||
|
||||
@@ -50,11 +50,11 @@ spec:
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if (include "redis.createConfigmap" .) }}
|
||||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/configmap: {{ pick ( include (print $.Template.BasePath "/configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
{{- end }}
|
||||
checksum/health: {{ include (print $.Template.BasePath "/health-configmap.yaml") . | sha256sum }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts-configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
checksum/health: {{ pick ( include (print $.Template.BasePath "/health-configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
checksum/scripts: {{ pick ( include (print $.Template.BasePath "/scripts-configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
checksum/secret: {{ pick ( include (print $.Template.BasePath "/secret.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
{{- if .Values.master.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.master.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -49,11 +49,11 @@ spec:
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if (include "redis.createConfigmap" .) }}
|
||||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/configmap: {{ pick ( include (print $.Template.BasePath "/configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
{{- end }}
|
||||
checksum/health: {{ include (print $.Template.BasePath "/health-configmap.yaml") . | sha256sum }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts-configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
checksum/health: {{ pick ( include (print $.Template.BasePath "/health-configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
checksum/scripts: {{ pick ( include (print $.Template.BasePath "/scripts-configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
checksum/secret: {{ pick ( include (print $.Template.BasePath "/secret.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
{{- if .Values.replica.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
40
bitnami/redis/templates/secret-svcbind.yaml
Normal file
40
bitnami/redis/templates/secret-svcbind.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
{{- /*
|
||||
Copyright VMware, Inc.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- if .Values.serviceBindings.enabled }}
|
||||
{{- $host := include "common.names.fullname" . }}
|
||||
{{- if not .Values.sentinel.enabled }}
|
||||
{{- $host = printf "%s-master" (include "common.names.fullname" .) }}
|
||||
{{- end }}
|
||||
{{- $port := print .Values.master.service.ports.redis }}
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
{{- $port = print .Values.sentinel.service.ports.redis }}
|
||||
{{- end }}
|
||||
{{- $password := include "redis.password" . }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}-svcbind
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: servicebinding.io/redis
|
||||
data:
|
||||
provider: {{ print "bitnami" | b64enc | quote }}
|
||||
type: {{ print "redis" | b64enc | quote }}
|
||||
host: {{ print $host | b64enc | quote }}
|
||||
port: {{ print $port | b64enc | quote }}
|
||||
password: {{ print $password | b64enc | quote }}
|
||||
{{- if $password }}
|
||||
uri: {{ printf "redis://%s@%s:%s" $password $host $port | b64enc | quote }}
|
||||
{{- else }}
|
||||
uri: {{ printf "redis://%s:%s" $host $port | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -3,16 +3,6 @@ Copyright VMware, Inc.
|
||||
SPDX-License-Identifier: APACHE-2.0
|
||||
*/}}
|
||||
|
||||
{{- $host := include "common.names.fullname" . }}
|
||||
{{- if not .Values.sentinel.enabled }}
|
||||
{{- $host = printf "%s-master" (include "common.names.fullname" .) }}
|
||||
{{- end }}
|
||||
{{- $port := print .Values.master.service.ports.redis }}
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
{{- $port = print .Values.sentinel.service.ports.redis }}
|
||||
{{- end }}
|
||||
{{- $password := include "redis.password" . }}
|
||||
|
||||
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -34,32 +24,5 @@ metadata:
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
redis-password: {{ print $password | b64enc | quote }}
|
||||
redis-password: {{ include "redis.password" . | b64enc | quote }}
|
||||
{{- end -}}
|
||||
{{- if .Values.serviceBindings.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}-svcbind
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: servicebinding.io/redis
|
||||
data:
|
||||
provider: {{ print "bitnami" | b64enc | quote }}
|
||||
type: {{ print "redis" | b64enc | quote }}
|
||||
host: {{ print $host | b64enc | quote }}
|
||||
port: {{ print $port | b64enc | quote }}
|
||||
password: {{ print $password | b64enc | quote }}
|
||||
{{- if $password }}
|
||||
uri: {{ printf "redis://%s@%s:%s" $password $host $port | b64enc | quote }}
|
||||
{{- else }}
|
||||
uri: {{ printf "redis://%s:%s" $host $port | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -54,11 +54,11 @@ spec:
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if (include "redis.createConfigmap" .) }}
|
||||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/configmap: {{ pick ( include (print $.Template.BasePath "/configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
{{- end }}
|
||||
checksum/health: {{ include (print $.Template.BasePath "/health-configmap.yaml") . | sha256sum }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts-configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
checksum/health: {{ pick ( include (print $.Template.BasePath "/health-configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
checksum/scripts: {{ pick ( include (print $.Template.BasePath "/scripts-configmap.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
checksum/secret: {{ pick ( include (print $.Template.BasePath "/secret.yaml") . | fromYaml ) "data" | toYaml | sha256sum }}
|
||||
{{- if .Values.replica.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user