{{- if .Values.auth -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "redis-ha.fullname" . }}
  labels:
{{ include "labels.standard" . | indent 4 }}
type: Opaque
data:
  {{- if .Values.redisPassword }}
  auth: {{ .Values.redisPassword | b64enc | quote }}
  {{- else }}
  auth: {{ randAlphaNum 10 | b64enc | quote }}
  {{- end }}
{{- end -}}
