Mike Elliott | d32d36e | 2018-02-12 15:54:03 -0500 | [diff] [blame^] | 1 | apiVersion: extensions/v1beta1 |
| 2 | kind: Deployment |
| 3 | metadata: |
| 4 | name: {{ include "common.fullname" . }} |
| 5 | namespace: {{ include "common.namespace" . }} |
| 6 | labels: |
| 7 | app: {{ include "common.name" . }} |
| 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 9 | release: {{ .Release.Name }} |
| 10 | heritage: {{ .Release.Service }} |
| 11 | spec: |
| 12 | replicas: {{ .Values.replicaCount }} |
| 13 | template: |
| 14 | metadata: |
| 15 | labels: |
| 16 | app: {{ include "common.name" . }} |
| 17 | release: {{ .Release.Name }} |
| 18 | spec: |
| 19 | hostname: mariadb |
| 20 | containers: |
| 21 | - name: {{ .Chart.Name }} |
| 22 | image: {{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }} |
| 23 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 24 | ports: |
| 25 | - containerPort: {{ .Values.service.internalPort }} |
| 26 | # disable liveness probe when breakpoints set in debugger |
| 27 | # so K8s doesn't restart unresponsive container |
| 28 | {{- if eq .Values.liveness.enabled true }} |
| 29 | livenessProbe: |
| 30 | tcpSocket: |
| 31 | port: {{ .Values.service.internalPort }} |
| 32 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 33 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 34 | {{end -}} |
| 35 | readinessProbe: |
| 36 | tcpSocket: |
| 37 | port: {{ .Values.service.internalPort }} |
| 38 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 39 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 40 | env: |
| 41 | - name: MYSQL_ROOT_PASSWORD |
| 42 | valueFrom: |
| 43 | secretKeyRef: |
| 44 | name: {{ template "common.fullname" . }} |
| 45 | key: db-root-password |
| 46 | volumeMounts: |
| 47 | - mountPath: /var/lib/mysql |
| 48 | name: mariadb-data |
| 49 | - mountPath: /etc/localtime |
| 50 | name: localtime |
| 51 | readOnly: true |
| 52 | - mountPath: /etc/mysql/conf.d |
| 53 | name: mariadb-conf |
| 54 | - mountPath: /docker-entrypoint-initdb.d/02-load-additional-changes.sh |
| 55 | name: mariadb-docker-entrypoint-initdb |
| 56 | subPath: 02-load-additional-changes.sh |
| 57 | - mountPath: /docker-entrypoint-initdb.d/01-load-default-sql-files.sh |
| 58 | name: mariadb-docker-entrypoint-initdb |
| 59 | subPath: 01-load-default-sql-files.sh |
| 60 | - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/automated-tests |
| 61 | name: mariadb-docker-entrypoint-automated-tests |
| 62 | - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default |
| 63 | name: mariadb-docker-entrypoint-bulkload-default |
| 64 | - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-dns |
| 65 | name: mariadb-docker-entrypoint-demo-dns |
| 66 | - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-vfw |
| 67 | name: mariadb-docker-entrypoint-demo-vfw |
| 68 | - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/camunda |
| 69 | name: mariadb-docker-entrypoint-camunda |
| 70 | - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/main-schemas |
| 71 | name: mariadb-docker-entrypoint-main-schemas |
| 72 | resources: |
| 73 | {{ toYaml .Values.resources | indent 12 }} |
| 74 | {{- if .Values.nodeSelector }} |
| 75 | nodeSelector: |
| 76 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 77 | {{- end -}} |
| 78 | {{- if .Values.affinity }} |
| 79 | affinity: |
| 80 | {{ toYaml .Values.affinity | indent 10 }} |
| 81 | {{- end }} |
| 82 | volumes: |
| 83 | {{- if .Values.persistence.enabled }} |
| 84 | - name: mariadb-data |
| 85 | persistentVolumeClaim: |
| 86 | claimName: {{ include "common.fullname" . }} |
| 87 | {{- else }} |
| 88 | emptyDir: {} |
| 89 | {{- end }} |
| 90 | - name: mariadb-conf |
| 91 | configMap: |
| 92 | name: confd-configmap |
| 93 | - name: mariadb-docker-entrypoint-initdb |
| 94 | configMap: |
| 95 | name: docker-entry-initd-configmap |
| 96 | - name: mariadb-docker-entrypoint-automated-tests |
| 97 | configMap: |
| 98 | name: automated-tests-configmap |
| 99 | - name: mariadb-docker-entrypoint-bulkload-default |
| 100 | configMap: |
| 101 | name: bulkload-default-configmap |
| 102 | - name: mariadb-docker-entrypoint-demo-dns |
| 103 | configMap: |
| 104 | name: demo-dns-configmap |
| 105 | - name: mariadb-docker-entrypoint-demo-vfw |
| 106 | configMap: |
| 107 | name: demo-vfw-configmap |
| 108 | - name: mariadb-docker-entrypoint-camunda |
| 109 | configMap: |
| 110 | name: scripts-camunda-configmap |
| 111 | - name: mariadb-docker-entrypoint-main-schemas |
| 112 | configMap: |
| 113 | name: main-schemas-configmap |
| 114 | - name: localtime |
| 115 | hostPath: |
| 116 | path: /etc/localtime |
| 117 | imagePullSecrets: |
| 118 | - name: "{{ include "common.name" . }}-docker-registry-key" |