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.
17 apiVersion: apps/v1beta1
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 }}
33 app: {{ include "common.fullname" . }}
34 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
35 release: "{{ include "common.release" . }}"
36 heritage: "{{ .Release.Service }}"
38 pod.alpha.kubernetes.io/initialized: "true"
40 {{- if .Values.nodeSelector }}
42 {{ toYaml .Values.nodeSelector | indent 8 }}
45 {{- if .Values.externalConfig }}
48 name: {{ include "common.fullname" . }}-external-config
52 name: {{ include "common.fullname" . }}
58 - name: {{ include "common.namespace" . }}-docker-registry-key
60 - name: {{ include "common.name" . }}
61 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
62 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
68 fieldPath: metadata.namespace
70 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.userCredentialsUID" .) "key" "login") | indent 14}}
71 - name: MYSQL_PASSWORD
72 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.userCredentialsUID" .) "key" "password") | indent 14}}
73 - name: MYSQL_DATABASE
74 value: {{ default "" .Values.config.mysqlDatabase | quote }}
75 - name: MYSQL_ROOT_PASSWORD
76 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .) "key" "password") | indent 14}}
78 - containerPort: {{ .Values.service.internalPort }}
79 name: {{ .Values.service.portName }}
80 - containerPort: {{ .Values.service.sstPort }}
81 name: {{ .Values.service.sstPortName }}
82 - containerPort: {{ .Values.service.replicationPort }}
83 name: {{ .Values.service.replicationName }}
84 - containerPort: {{ .Values.service.istPort }}
85 name: {{ .Values.service.istPortName }}
89 - /usr/share/container-scripts/mysql/readiness-probe.sh
90 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
91 periodSeconds: {{ .Values.readiness.periodSeconds }}
92 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
93 {{- if eq .Values.liveness.enabled true }}
96 command: ["mysqladmin", "ping"]
97 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
98 periodSeconds: {{ .Values.liveness.periodSeconds }}
99 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
102 {{ include "common.resources" . | indent 12 }}
104 {{- if .Values.externalConfig }}
105 - mountPath: /etc/config
108 - mountPath: /etc/localtime
111 - mountPath: /usr/share/container-scripts/mysql/configure-mysql.sh
112 subPath: configure-mysql.sh
114 {{- if .Values.persistence.enabled }}
115 - mountPath: /var/lib/mysql
116 name: {{ include "common.fullname" . }}-data
118 - name: {{ include "common.name" . }}-prepare
119 image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
120 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
121 command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
123 - name: {{ include "common.fullname" . }}-data
124 mountPath: /var/lib/mysql
125 volumeClaimTemplates:
127 name: {{ include "common.fullname" . }}-data
129 name: {{ include "common.fullname" . }}
130 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
131 release: "{{ include "common.release" . }}"
132 heritage: "{{ .Release.Service }}"
135 - {{ .Values.persistence.accessMode | quote }}
136 storageClassName: {{ include "common.storageClass" . }}
139 storage: {{ .Values.persistence.size | quote }}