2 # Copyright © 2019 Amdocs, Bell Canada, Orange, Samsung Electronics
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
23 app: {{ include "common.fullname" . }}
24 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
25 release: "{{ include "common.release" . }}"
26 heritage: "{{ .Release.Service }}"
28 serviceName: {{ .Values.service.name }}
29 replicas: {{ .Values.replicaCount }}
32 app: {{ include "common.fullname" . }}
36 app: {{ include "common.fullname" . }}
37 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
38 release: "{{ include "common.release" . }}"
39 heritage: "{{ .Release.Service }}"
41 pod.alpha.kubernetes.io/initialized: "true"
43 {{- if .Values.nodeSelector }}
45 {{ toYaml .Values.nodeSelector | indent 8 }}
48 {{- if .Values.externalConfig }}
51 name: {{ include "common.fullname" . }}-external-config
55 name: {{ include "common.fullname" . }}
61 - name: {{ include "common.namespace" . }}-docker-registry-key
63 - name: {{ include "common.name" . }}
64 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
65 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
71 fieldPath: metadata.namespace
73 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.userCredentialsUID" .) "key" "login") | indent 14}}
74 - name: MYSQL_PASSWORD
75 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.userCredentialsUID" .) "key" "password") | indent 14}}
76 - name: MYSQL_DATABASE
77 value: {{ default "" .Values.config.mysqlDatabase | quote }}
78 - name: MYSQL_ROOT_PASSWORD
79 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .) "key" "password") | indent 14}}
81 - containerPort: {{ .Values.service.internalPort }}
82 name: {{ .Values.service.portName }}
83 - containerPort: {{ .Values.service.sstPort }}
84 name: {{ .Values.service.sstPortName }}
85 - containerPort: {{ .Values.service.replicationPort }}
86 name: {{ .Values.service.replicationName }}
87 - containerPort: {{ .Values.service.istPort }}
88 name: {{ .Values.service.istPortName }}
92 - /usr/share/container-scripts/mysql/readiness-probe.sh
93 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.readiness.periodSeconds }}
95 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
96 {{- if eq .Values.liveness.enabled true }}
99 command: ["mysqladmin", "ping"]
100 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
101 periodSeconds: {{ .Values.liveness.periodSeconds }}
102 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
105 {{ include "common.resources" . | indent 12 }}
107 {{- if .Values.externalConfig }}
108 - mountPath: /etc/config
111 - mountPath: /etc/localtime
114 - mountPath: /usr/share/container-scripts/mysql/configure-mysql.sh
115 subPath: configure-mysql.sh
117 {{- if .Values.persistence.enabled }}
118 - mountPath: /var/lib/mysql
119 name: {{ include "common.fullname" . }}-data
121 - name: {{ include "common.name" . }}-prepare
122 image: {{ include "repositoryGenerator.image.busybox" . }}
123 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
124 command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
126 - name: {{ include "common.fullname" . }}-data
127 mountPath: /var/lib/mysql
128 volumeClaimTemplates:
130 name: {{ include "common.fullname" . }}-data
132 name: {{ include "common.fullname" . }}
133 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
134 release: "{{ include "common.release" . }}"
135 heritage: "{{ .Release.Service }}"
138 - {{ .Values.persistence.accessMode | quote }}
139 storageClassName: {{ include "common.storageClass" . }}
142 storage: {{ .Values.persistence.size | quote }}