Initial commit

This commit is contained in:
marsal wang
2021-12-23 13:52:28 +08:00
commit 06000029e8
45 changed files with 3708 additions and 0 deletions

View 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 }}