1 # Copyright © 2018 Amdocs, Bell Canada
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: {{ include "common.fullname" . }}
27 serviceName: {{ .Values.service.name }}
28 replicas: {{ .Values.replicaCount }}
32 app: {{ include "common.fullname" . }}
33 release: {{ .Release.Name }}
35 pod.alpha.kubernetes.io/initialized: "true"
37 {{- if .Values.nodeSelector }}
39 {{ toYaml .Values.nodeSelector | indent 8 }}
42 {{- if .Values.externalConfig }}
45 name: {{ include "common.fullname" . }}-externalconfig
51 - name: {{ include "common.namespace" . }}-docker-registry-key
53 - name: {{ include "common.fullname" . }}
54 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
61 fieldPath: metadata.namespace
63 value: {{ default "" .Values.config.userName | quote }}
64 - name: MYSQL_PASSWORD
67 name: {{ template "common.fullname" . }}
69 - name: MYSQL_DATABASE
70 value: {{ default "" .Values.config.mysqlDatabase | quote }}
71 - name: MYSQL_ROOT_PASSWORD
74 name: {{ template "common.fullname" . }}
77 - containerPort: {{ .Values.service.internalPort }}
78 name: {{ .Values.service.name }}
79 - containerPort: {{ .Values.service.sstPort }}
80 name: {{ .Values.service.sstName }}
81 - containerPort: {{ .Values.service.replicationPort }}
82 name: {{ .Values.service.replicationName }}
83 - containerPort: {{ .Values.service.istPort }}
84 name: {{ .Values.service.istName }}
88 - /usr/share/container-scripts/mysql/readiness-probe.sh
89 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
90 periodSeconds: {{ .Values.readiness.periodSeconds }}
91 {{- if eq .Values.liveness.enabled true }}
94 command: ["mysqladmin", "ping"]
95 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.liveness.periodSeconds }}
97 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
100 {{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
102 {{- if .Values.externalConfig }}
103 - mountPath: /etc/config
106 - mountPath: /etc/localtime
109 {{- if .Values.persistence.enabled }}
110 - mountPath: /var/lib/mysql
111 name: {{ include "common.fullname" . }}-data
114 - name: mariadb-galera-prepare
115 image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
116 command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
118 - name: {{ include "common.fullname" . }}-data
119 mountPath: /var/lib/mysql
120 volumeClaimTemplates:
122 name: {{ include "common.fullname" . }}-data
124 {{- if .Values.persistence.storageClass }}
125 volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
127 volume.alpha.kubernetes.io/storage-class: default
131 - {{ .Values.persistence.accessMode | quote }}
134 storage: {{ .Values.persistence.size | quote }}