vaibhav_16dec | e04b2fe | 2018-03-22 09:07:12 +0000 | [diff] [blame] | 1 | # 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 Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 14 | apiVersion: extensions/v1beta1 |
| 15 | kind: Deployment |
| 16 | metadata: |
Mandeep Khinda | a57d8dd | 2018-03-09 14:29:37 +0000 | [diff] [blame] | 17 | name: {{ include "common.fullname" . }} |
Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 18 | 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 }} |
| 24 | spec: |
| 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 Khinda | 0fe4eb7 | 2018-04-20 21:02:45 +0000 | [diff] [blame] | 33 | 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 Parthasarathy | 3cd3fb1 | 2018-09-05 01:47:29 +0000 | [diff] [blame] | 42 | chmod -R 755 /docker-entrypoint-initdb.d; |
Mandeep Khinda | 0fe4eb7 | 2018-04-20 21:02:45 +0000 | [diff] [blame] | 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 Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 49 | containers: |
Mandeep Khinda | 0fe4eb7 | 2018-04-20 21:02:45 +0000 | [diff] [blame] | 50 | - 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 Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 84 | {{ include "common.resources" . | indent 12 }} |
Mandeep Khinda | 0fe4eb7 | 2018-04-20 21:02:45 +0000 | [diff] [blame] | 85 | {{- if .Values.nodeSelector }} |
| 86 | nodeSelector: |
Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 87 | {{ toYaml .Values.nodeSelector | indent 10 }} |
Mandeep Khinda | 0fe4eb7 | 2018-04-20 21:02:45 +0000 | [diff] [blame] | 88 | {{- end -}} |
| 89 | {{- if .Values.affinity }} |
| 90 | affinity: |
Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 91 | {{ toYaml .Values.affinity | indent 10 }} |
Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 92 | {{- end }} |
Mandeep Khinda | 0fe4eb7 | 2018-04-20 21:02:45 +0000 | [diff] [blame] | 93 | 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 Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 109 | imagePullSecrets: |
vaibhav16dec | 0da8829 | 2018-08-13 06:10:27 +0000 | [diff] [blame] | 110 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |