blob: 6c7b85fbc87590955641f0db1f4d5aae945cc1c0 [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.
Mike Elliottd32d36e2018-02-12 15:54:03 -050014apiVersion: extensions/v1beta1
15kind: Deployment
16metadata:
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000017 name: {{ include "common.fullname" . }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050018 namespace: {{ include "common.namespace" . }}
19 labels:
20 app: {{ include "common.name" . }}
21 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
22 release: {{ .Release.Name }}
23 heritage: {{ .Release.Service }}
24spec:
25 replicas: {{ .Values.replicaCount }}
26 template:
27 metadata:
28 labels:
29 app: {{ include "common.name" . }}
30 release: {{ .Release.Name }}
31 spec:
32 hostname: mariadb
Mandeep Khinda0fe4eb72018-04-20 21:02:45 +000033 initContainers:
34 - name: {{ include "common.name" . }}-inject-testlab-project
35 command:
36 - /bin/bash
37 - -c
38 - >
39 git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
40 echo "Clone complete. Copying from /tmp/gerrit/volumes/mariadb/docker-entrypoint-initdb.d to /docker-entrypoint-initdb.d";
41 cp -rf /tmp/gerrit/volumes/mariadb/docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d;
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000042 chmod -R 755 /docker-entrypoint-initdb.d;
Mandeep Khinda0fe4eb72018-04-20 21:02:45 +000043 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:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000084{{ include "common.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:
vaibhav16dec0da88292018-08-13 06:10:27 +0000110 - name: "{{ include "common.namespace" . }}-docker-registry-key"