Initial commit
This commit is contained in:
39
mysql/templates/secrets.yaml
Normal file
39
mysql/templates/secrets.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
{{- if eq (include "mysql.createSecret" .) "true" }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
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: Opaque
|
||||
data:
|
||||
{{- if not (empty .Values.auth.rootPassword) }}
|
||||
mysql-root-password: {{ .Values.auth.rootPassword | b64enc | quote }}
|
||||
{{- else if (not .Values.auth.forcePassword) }}
|
||||
mysql-root-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||
{{- else }}
|
||||
mysql-root-password: {{ required "A MySQL Root Password is required!" .Values.auth.rootPassword }}
|
||||
{{- end }}
|
||||
{{- if and (not (empty .Values.auth.username)) (not (empty .Values.auth.password)) }}
|
||||
mysql-password: {{ .Values.auth.password | b64enc | quote }}
|
||||
{{- else if (not .Values.auth.forcePassword) }}
|
||||
mysql-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||
{{- else }}
|
||||
mysql-password: {{ required "A MySQL Database Password is required!" .Values.auth.password }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.architecture "replication" }}
|
||||
{{- if not (empty .Values.auth.replicationPassword) }}
|
||||
mysql-replication-password: {{ .Values.auth.replicationPassword | b64enc | quote }}
|
||||
{{- else if (not .Values.auth.forcePassword) }}
|
||||
mysql-replication-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||
{{- else }}
|
||||
mysql-replication-password: {{ required "A MySQL Replication Password is required!" .Values.auth.replicationPassword }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
Reference in New Issue
Block a user