X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=otf-helm%2Fotf%2Fcharts%2Fdatabases%2Fmysqldb%2Ftemplates%2Fsecrets.yaml;fp=otf-helm%2Fotf%2Fcharts%2Fdatabases%2Fmysqldb%2Ftemplates%2Fsecrets.yaml;h=1ca42a8e12a89694b39a09284ed5c29fa965fe06;hp=0000000000000000000000000000000000000000;hb=321c6b595a3f05db9e4327c16af85c16752f9ec2;hpb=29cd8447ada8036b91ad2ca75a3c1c3fe0d8ba55 diff --git a/otf-helm/otf/charts/databases/mysqldb/templates/secrets.yaml b/otf-helm/otf/charts/databases/mysqldb/templates/secrets.yaml new file mode 100644 index 0000000..1ca42a8 --- /dev/null +++ b/otf-helm/otf/charts/databases/mysqldb/templates/secrets.yaml @@ -0,0 +1,57 @@ +{{- if not .Values.existingSecret }} +{{- if or (not .Values.allowEmptyRootPassword) (or .Values.mysqlRootPassword .Values.mysqlPassword) }} +apiVersion: v1 +kind: Secret +metadata: + #name: {{ template "mysql.fullname" . }} + name: mysql + namespace: {{ .Release.Namespace }} + labels: + # app: {{ template "mysql.fullname" . }} + app: mysql + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + mysql-database: {{ .Values.mysqlDatabase | b64enc | quote }} + mysql-username: {{ .Values.mysqlUser | b64enc | quote }} + mysql-ip: {{ .Values.mysqlIP | b64enc | quote }} + {{ if .Values.mysqlRootPassword }} + mysql-root-password: {{ .Values.mysqlRootPassword | b64enc | quote }} + {{ else }} + {{ if not .Values.allowEmptyRootPassword }} + mysql-root-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} + {{ end }} + {{ if .Values.mysqlPassword }} + mysql-password: {{ .Values.mysqlPassword | b64enc | quote }} + {{ else }} + {{ if not .Values.allowEmptyRootPassword }} + mysql-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} + {{ end }} +{{ end }} +{{- if .Values.ssl.enabled }} +{{ if .Values.ssl.certificates }} +{{- range .Values.ssl.certificates }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name }} + labels: + # app: {{ template "mysql.fullname" $ }} + app: mysql + chart: "{{ $.Chart.Name }}-{{ $.Chart.Version }}" + release: "{{ $.Release.Name }}" + heritage: "{{ $.Release.Service }}" +type: Opaque +data: + ca.pem: {{ .ca | b64enc }} + server-cert.pem: {{ .cert | b64enc }} + server-key.pem: {{ .key | b64enc }} +{{- end }} +{{- end }} +{{- end }} +{{- end }}