blob: 6d30b3667d88c220b669e057d5096f058cd68112 [file] [log] [blame]
Jakub Latusekfcf67842020-10-21 13:36:29 +02001{{/*
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00002# Copyright © 2017 Amdocs, Bell Canada
Mukul379e2522018-09-05 12:26:02 +00003# Modifications Copyright © 2018 AT&T
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusekfcf67842020-10-21 13:36:29 +020016*/}}
vaibhav_16dece04b2fe2018-03-22 09:07:12 +000017
Magdalena_Biernacka7d0dcbe2020-07-12 23:21:43 +020018apiVersion: apps/v1
vaibhav_16decf67e4182018-03-19 05:45:47 +000019kind: Deployment
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000027 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
Magdalena_Biernacka7d0dcbe2020-07-12 23:21:43 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000033 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000038 spec:
39 containers:
40 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000041 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
vaibhav_16decf67e4182018-03-19 05:45:47 +000042 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 ports:
44 - containerPort: {{ .Values.service.internalPort }}
45 # disable liveness probe when breakpoints set in debugger
46 # so K8s doesn't restart unresponsive container
47 {{- if eq .Values.liveness.enabled true }}
48 livenessProbe:
49 tcpSocket:
50 port: {{ .Values.service.internalPort }}
51 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
52 periodSeconds: {{ .Values.liveness.periodSeconds }}
53 {{ end -}}
54 readinessProbe:
55 tcpSocket:
56 port: {{ .Values.service.internalPort }}
57 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
58 periodSeconds: {{ .Values.readiness.periodSeconds }}
59 env:
JulienBe26df3202020-04-10 16:50:08 +020060 - name: MYSQL_USER
61 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
62 - name: MYSQL_PASSWORD
63 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
64 - name: MYSQL_ROOT_PASSWORD
65 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-pass" "key" "password") | indent 12 }}
66 - name: MYSQL_DATABASE
67 value: {{ tpl .Values.db.databaseName .}}
vaibhav_16decf67e4182018-03-19 05:45:47 +000068 volumeMounts:
Krzysztof Opasiak37a4e702020-05-25 22:22:33 +020069 - mountPath: /docker-entrypoint.sh
70 subPath: docker-entrypoint.sh
71 name: init-script
vaibhav_16decf67e4182018-03-19 05:45:47 +000072 - mountPath: /etc/localtime
73 name: localtime
74 readOnly: true
JulienBe26df3202020-04-10 16:50:08 +020075 - mountPath: /docker-entrypoint-initdb.d/
vaibhav_16decf67e4182018-03-19 05:45:47 +000076 name: docker-entrypoint-bulkload
77 - mountPath: /etc/mysql/conf.d/conf1/
78 name: clamp-mariadb-conf
79 - mountPath: /var/lib/mysql
80 name: clamp-mariadb-data
81 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000082{{ include "common.resources" . | indent 12 }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000083 {{- if .Values.nodeSelector }}
84 nodeSelector:
85{{ toYaml .Values.nodeSelector | indent 10 }}
86 {{- end -}}
87 {{- if .Values.affinity }}
88 affinity:
89{{ toYaml .Values.affinity | indent 10 }}
90 {{- end }}
91 volumes:
92 {{- if .Values.persistence.enabled }}
93 - name: clamp-mariadb-data
94 persistentVolumeClaim:
95 claimName: {{ include "common.fullname" . }}
96 {{- else }}
97 emptyDir: {}
98 {{- end }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000099 - name: docker-entrypoint-bulkload
100 configMap:
101 name: clamp-entrypoint-bulkload-configmap
102 - name: clamp-mariadb-conf
103 configMap:
104 name: clamp-mariadb-conf-configmap
105 - name: localtime
106 hostPath:
107 path: /etc/localtime
Krzysztof Opasiak37a4e702020-05-25 22:22:33 +0200108 - name: init-script
109 configMap:
110 name: {{ include "common.fullname" . }}
111 defaultMode: 0755
vaibhav_16decf67e4182018-03-19 05:45:47 +0000112 imagePullSecrets:
113 - name: "{{ include "common.namespace" . }}-docker-registry-key"