12345678910111213141516171819202122 |
- {{- if or (and (not .Values.admin.existingSecret) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD__FILE) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD)) (and .Values.ldap.enabled (not .Values.ldap.existingSecret)) }}
- apiVersion: v1
- kind: Secret
- metadata:
- name: {{ template "grafana.fullname" . }}
- namespace: {{ template "grafana.namespace" . }}
- labels:
- {{- include "grafana.labels" . | nindent 4 }}
- type: Opaque
- data:
- {{- if and (not .Values.admin.existingSecret) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD__FILE) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD) }}
- admin-user: {{ .Values.adminUser | b64enc | quote }}
- {{- if .Values.adminPassword }}
- admin-password: {{ .Values.adminPassword | b64enc | quote }}
- {{- else }}
- admin-password: {{ randAlphaNum 40 | b64enc | quote }}
- {{- end }}
- {{- end }}
- {{- if not .Values.ldap.existingSecret }}
- ldap-toml: {{ .Values.ldap.config | b64enc | quote }}
- {{- end }}
- {{- end }}
|