2023-07-05 19:22:09 +00:00
|
|
|
{{- /*
|
|
|
|
Copyright VMware, Inc.
|
|
|
|
SPDX-License-Identifier: APACHE-2.0
|
|
|
|
*/}}
|
|
|
|
|
2023-02-22 15:04:28 +00:00
|
|
|
{{- $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" . }}
|
|
|
|
|
2022-11-10 21:45:34 +00:00
|
|
|
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}}
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
metadata:
|
|
|
|
name: {{ template "common.names.fullname" . }}
|
|
|
|
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 or .Values.secretAnnotations .Values.commonAnnotations }}
|
|
|
|
annotations:
|
|
|
|
{{- if .Values.secretAnnotations }}
|
|
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.commonAnnotations }}
|
|
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
type: Opaque
|
|
|
|
data:
|
2023-03-28 14:02:53 +00:00
|
|
|
redis-password: {{ print $password | b64enc | quote }}
|
2022-11-10 21:45:34 +00:00
|
|
|
{{- end -}}
|
2023-02-22 15:04:28 +00:00
|
|
|
{{- 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 }}
|
2023-07-17 16:53:41 +00:00
|
|
|
{{- if $password }}
|
2023-02-22 15:04:28 +00:00
|
|
|
uri: {{ printf "redis://%s@%s:%s" $password $host $port | b64enc | quote }}
|
2023-07-17 16:53:41 +00:00
|
|
|
{{- else }}
|
|
|
|
uri: {{ printf "redis://%s:%s" $host $port | b64enc | quote }}
|
|
|
|
{{- end }}
|
2023-02-22 15:04:28 +00:00
|
|
|
{{- end }}
|