apiVersion: v1
kind: Secret
metadata:
  name: {{ include "centrifugo.fullname" . }}
  labels:
    app: {{ include "centrifugo.name" . }}
    chart: {{ include "centrifugo.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
type: Opaque
data:
  {{- if .Values.admin.password }}
  admin-password: {{ .Values.admin.password | b64enc | quote }}
  {{- else }}
  admin-password: {{ randAlphaNum 10 | b64enc | quote }}
  {{- end }}
  {{- if .Values.admin.secret }}
  admin-secret: {{ .Values.admin.secret | b64enc | quote }}
  {{- else }}
  admin-secret: {{ randAlphaNum 10 | b64enc | quote }}
  {{- end }}
  {{- if .Values.secret }}
  secret: {{ .Values.secret | b64enc | quote }}
  {{- else }}
  secret: {{ randAlphaNum 10 | b64enc | quote }}
  {{- end }}
