secret.yaml 942 B

12345678910111213141516171819202122
  1. {{- 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)) }}
  2. apiVersion: v1
  3. kind: Secret
  4. metadata:
  5. name: {{ template "grafana.fullname" . }}
  6. namespace: {{ template "grafana.namespace" . }}
  7. labels:
  8. {{- include "grafana.labels" . | nindent 4 }}
  9. type: Opaque
  10. data:
  11. {{- if and (not .Values.admin.existingSecret) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD__FILE) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD) }}
  12. admin-user: {{ .Values.adminUser | b64enc | quote }}
  13. {{- if .Values.adminPassword }}
  14. admin-password: {{ .Values.adminPassword | b64enc | quote }}
  15. {{- else }}
  16. admin-password: {{ randAlphaNum 40 | b64enc | quote }}
  17. {{- end }}
  18. {{- end }}
  19. {{- if not .Values.ldap.existingSecret }}
  20. ldap-toml: {{ .Values.ldap.config | b64enc | quote }}
  21. {{- end }}
  22. {{- end }}