1 # Copyright © 2019 Amdocs, Bell Canada, Orange
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 apiVersion: apps/v1beta1
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
21 app: {{ include "common.fullname" . }}
22 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
23 release: "{{ .Release.Name }}"
24 heritage: "{{ .Release.Service }}"
26 serviceName: {{ .Values.service.name }}
27 replicas: {{ .Values.replicaCount }}
31 app: {{ include "common.fullname" . }}
32 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
33 release: "{{ .Release.Name }}"
34 heritage: "{{ .Release.Service }}"
36 pod.alpha.kubernetes.io/initialized: "true"
38 {{- if .Values.nodeSelector }}
40 {{ toYaml .Values.nodeSelector | indent 8 }}
43 {{- if .Values.externalConfig }}
46 name: {{ include "common.fullname" . }}-external-config
52 - name: {{ include "common.namespace" . }}-docker-registry-key
54 - name: {{ include "common.name" . }}
55 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
62 fieldPath: metadata.namespace
64 value: {{ default "" .Values.config.userName | quote }}
65 - name: MYSQL_PASSWORD
68 name: {{ template "common.fullname" . }}
70 - name: MYSQL_DATABASE
71 value: {{ default "" .Values.config.mysqlDatabase | quote }}
72 - name: MYSQL_ROOT_PASSWORD
75 name: {{ template "common.fullname" . }}
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 {{- if .Values.persistence.enabled }}
112 - mountPath: /var/lib/mysql
113 name: {{ include "common.fullname" . }}-data
115 - name: {{ include "common.name" . }}-prepare
116 image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
117 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
118 command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
120 - name: {{ include "common.fullname" . }}-data
121 mountPath: /var/lib/mysql
122 volumeClaimTemplates:
124 name: {{ include "common.fullname" . }}-data
126 name: {{ include "common.fullname" . }}
127 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
128 release: "{{ .Release.Name }}"
129 heritage: "{{ .Release.Service }}"
132 - {{ .Values.persistence.accessMode | quote }}
133 storageClassName: {{ include "common.storageClass" . }}
136 storage: {{ .Values.persistence.size | quote }}