blob: c85fe79103898900bf61ff513f7b791255f059a8 [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
Mandeep Khinda0fe4eb72018-04-20 21:02:45 +000034 initContainers:
35 - name: {{ include "common.name" . }}-inject-testlab-project
36 command:
37 - /bin/bash
38 - -c
39 - >
40 git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
41 echo "Clone complete. Copying from /tmp/gerrit/volumes/mariadb/docker-entrypoint-initdb.d to /docker-entrypoint-initdb.d";
42 cp -rf /tmp/gerrit/volumes/mariadb/docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d;
43 echo "Done.";
44 image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
45 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 volumeMounts:
47 - name: docker-entrypoint-initdb-d
48 mountPath: "/docker-entrypoint-initdb.d"
Mike Elliottd32d36e2018-02-12 15:54:03 -050049 containers:
Mandeep Khinda0fe4eb72018-04-20 21:02:45 +000050 - name: {{ include "common.name" . }}
51 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 ports:
54 - containerPort: {{ .Values.service.internalPort }}
55 {{ if eq .Values.liveness.enabled true }}
56 livenessProbe:
57 tcpSocket:
58 port: {{ .Values.service.internalPort }}
59 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.liveness.periodSeconds }}
61 {{ end }}
62 readinessProbe:
63 tcpSocket:
64 port: {{ .Values.service.internalPort }}
65 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.readiness.periodSeconds }}
67 env:
68 - name: MYSQL_ROOT_PASSWORD
69 valueFrom:
70 secretKeyRef:
71 name: {{ template "common.fullname" . }}
72 key: db-root-password
73 volumeMounts:
74 - mountPath: /var/lib/mysql
75 name: mariadb-data
76 - mountPath: /etc/localtime
77 name: localtime
78 readOnly: true
79 - mountPath: /etc/mysql/conf.d
80 name: mariadb-conf
81 - name: docker-entrypoint-initdb-d
82 mountPath: "/docker-entrypoint-initdb.d"
83 resources:
Mike Elliottd32d36e2018-02-12 15:54:03 -050084{{ toYaml .Values.resources | indent 12 }}
Mandeep Khinda0fe4eb72018-04-20 21:02:45 +000085 {{- if .Values.nodeSelector }}
86 nodeSelector:
Mike Elliottd32d36e2018-02-12 15:54:03 -050087{{ toYaml .Values.nodeSelector | indent 10 }}
Mandeep Khinda0fe4eb72018-04-20 21:02:45 +000088 {{- end -}}
89 {{- if .Values.affinity }}
90 affinity:
Mike Elliottd32d36e2018-02-12 15:54:03 -050091{{ toYaml .Values.affinity | indent 10 }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050092 {{- end }}
Mandeep Khinda0fe4eb72018-04-20 21:02:45 +000093 volumes:
94 - name: mariadb-data
95 {{- if .Values.persistence.enabled }}
96 persistentVolumeClaim:
97 claimName: {{ include "common.fullname" . }}
98 {{- else }}
99 emptyDir: {}
100 {{- end }}
101 - name: mariadb-conf
102 configMap:
103 name: confd-configmap
104 - name: localtime
105 hostPath:
106 path: /etc/localtime
107 - name: docker-entrypoint-initdb-d
108 emptyDir: {}
Mike Elliottd32d36e2018-02-12 15:54:03 -0500109 imagePullSecrets:
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +0000110 - name: "{{ include "common.namespace" . }}-docker-registry-key"