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. |
| 14 | |
Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 15 | apiVersion: extensions/v1beta1 |
| 16 | kind: Deployment |
| 17 | metadata: |
Mandeep Khinda | a57d8dd | 2018-03-09 14:29:37 +0000 | [diff] [blame] | 18 | name: {{ include "common.fullname" . }} |
Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 19 | 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 }} |
| 25 | spec: |
| 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 Khinda | 0fe4eb7 | 2018-04-20 21:02:45 +0000 | [diff] [blame] | 34 | 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 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: |
Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame] | 84 | {{ toYaml .Values.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: |
Mandeep Khinda | a57d8dd | 2018-03-09 14:29:37 +0000 | [diff] [blame] | 110 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |