blob: 5267cc0409ba9c2dc2565f7e051d68fc120b76b7 [file] [log] [blame]
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00001# Copyright © 2017 Amdocs, Bell Canada
2#
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
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
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.
14
Mike Elliottd32d36e2018-02-12 15:54:03 -050015apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000018 name: {{ include "common.fullname" . }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050019 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
31 release: {{ .Release.Name }}
32 spec:
33 hostname: mariadb
34 containers:
35 - name: {{ .Chart.Name }}
36 image: {{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}
37 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 ports:
39 - containerPort: {{ .Values.service.internalPort }}
40 # disable liveness probe when breakpoints set in debugger
41 # so K8s doesn't restart unresponsive container
42 {{- if eq .Values.liveness.enabled true }}
43 livenessProbe:
44 tcpSocket:
45 port: {{ .Values.service.internalPort }}
46 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
47 periodSeconds: {{ .Values.liveness.periodSeconds }}
48 {{end -}}
49 readinessProbe:
50 tcpSocket:
51 port: {{ .Values.service.internalPort }}
52 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
53 periodSeconds: {{ .Values.readiness.periodSeconds }}
54 env:
55 - name: MYSQL_ROOT_PASSWORD
56 valueFrom:
57 secretKeyRef:
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000058 name: {{ template "common.fullname" . }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050059 key: db-root-password
60 volumeMounts:
61 - mountPath: /var/lib/mysql
62 name: mariadb-data
63 - mountPath: /etc/localtime
64 name: localtime
65 readOnly: true
66 - mountPath: /etc/mysql/conf.d
67 name: mariadb-conf
68 - mountPath: /docker-entrypoint-initdb.d/02-load-additional-changes.sh
69 name: mariadb-docker-entrypoint-initdb
70 subPath: 02-load-additional-changes.sh
71 - mountPath: /docker-entrypoint-initdb.d/01-load-default-sql-files.sh
72 name: mariadb-docker-entrypoint-initdb
73 subPath: 01-load-default-sql-files.sh
74 - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/automated-tests
75 name: mariadb-docker-entrypoint-automated-tests
76 - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default
77 name: mariadb-docker-entrypoint-bulkload-default
78 - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-dns
79 name: mariadb-docker-entrypoint-demo-dns
80 - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-vfw
81 name: mariadb-docker-entrypoint-demo-vfw
82 - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/camunda
83 name: mariadb-docker-entrypoint-camunda
84 - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/main-schemas
85 name: mariadb-docker-entrypoint-main-schemas
86 resources:
87{{ toYaml .Values.resources | indent 12 }}
88 {{- if .Values.nodeSelector }}
89 nodeSelector:
90{{ toYaml .Values.nodeSelector | indent 10 }}
91 {{- end -}}
92 {{- if .Values.affinity }}
93 affinity:
94{{ toYaml .Values.affinity | indent 10 }}
95 {{- end }}
96 volumes:
97 {{- if .Values.persistence.enabled }}
98 - name: mariadb-data
99 persistentVolumeClaim:
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +0000100 claimName: {{ include "common.fullname" . }}
Mike Elliottd32d36e2018-02-12 15:54:03 -0500101 {{- else }}
102 emptyDir: {}
103 {{- end }}
104 - name: mariadb-conf
105 configMap:
106 name: confd-configmap
107 - name: mariadb-docker-entrypoint-initdb
108 configMap:
109 name: docker-entry-initd-configmap
110 - name: mariadb-docker-entrypoint-automated-tests
111 configMap:
112 name: automated-tests-configmap
113 - name: mariadb-docker-entrypoint-bulkload-default
114 configMap:
115 name: bulkload-default-configmap
116 - name: mariadb-docker-entrypoint-demo-dns
117 configMap:
118 name: demo-dns-configmap
119 - name: mariadb-docker-entrypoint-demo-vfw
120 configMap:
121 name: demo-vfw-configmap
122 - name: mariadb-docker-entrypoint-camunda
123 configMap:
124 name: scripts-camunda-configmap
125 - name: mariadb-docker-entrypoint-main-schemas
126 configMap:
127 name: main-schemas-configmap
128 - name: localtime
129 hostPath:
130 path: /etc/localtime
131 imagePullSecrets:
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +0000132 - name: "{{ include "common.namespace" . }}-docker-registry-key"