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
54 - name: {{ include "common.namespace" . }}-docker-registry-key
56 - name: {{ include "common.name" . }}
57 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
58 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
64 fieldPath: metadata.namespace
66 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.userCredentialsUID" .) "key" "login") | indent 14}}
67 - name: MYSQL_PASSWORD
68 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.userCredentialsUID" .) "key" "password") | indent 14}}
69 - name: MYSQL_DATABASE
70 value: {{ default "" .Values.config.mysqlDatabase | quote }}
71 - name: MYSQL_ROOT_PASSWORD
72 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .) "key" "password") | indent 14}}
74 - containerPort: {{ .Values.service.internalPort }}
75 name: {{ .Values.service.portName }}
76 - containerPort: {{ .Values.service.sstPort }}
77 name: {{ .Values.service.sstPortName }}
78 - containerPort: {{ .Values.service.replicationPort }}
79 name: {{ .Values.service.replicationName }}
80 - containerPort: {{ .Values.service.istPort }}
81 name: {{ .Values.service.istPortName }}
85 - /usr/share/container-scripts/mysql/readiness-probe.sh
86 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
87 periodSeconds: {{ .Values.readiness.periodSeconds }}
88 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
89 {{- if eq .Values.liveness.enabled true }}
92 command: ["mysqladmin", "ping"]
93 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.liveness.periodSeconds }}
95 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
98 {{ include "common.resources" . | indent 12 }}
100 {{- if .Values.externalConfig }}
101 - mountPath: /etc/config
104 - mountPath: /etc/localtime
107 {{- if .Values.persistence.enabled }}
108 - mountPath: /var/lib/mysql
109 name: {{ include "common.fullname" . }}-data
111 - name: {{ include "common.name" . }}-prepare
112 image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
113 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
114 command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
116 - name: {{ include "common.fullname" . }}-data
117 mountPath: /var/lib/mysql
118 volumeClaimTemplates:
120 name: {{ include "common.fullname" . }}-data
122 name: {{ include "common.fullname" . }}
123 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
124 release: "{{ include "common.release" . }}"
125 heritage: "{{ .Release.Service }}"
128 - {{ .Values.persistence.accessMode | quote }}
129 storageClassName: {{ include "common.storageClass" . }}
132 storage: {{ .Values.persistence.size | quote }}