vaibhav_16dec | f67e418 | 2018-03-19 05:45:47 +0000 | [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 | initContainers: |
| 20 | - command: |
| 21 | - /root/ready.py |
| 22 | args: |
| 23 | - --container-name |
| 24 | - {{ .Values.mariadb.nameOverride }} |
| 25 | env: |
| 26 | - name: NAMESPACE |
| 27 | valueFrom: |
| 28 | fieldRef: |
| 29 | apiVersion: v1 |
| 30 | fieldPath: metadata.namespace |
| 31 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 32 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 33 | name: {{ include "common.name" . }}-readiness |
| 34 | containers: |
| 35 | - name: {{ include "common.name" . }} |
| 36 | image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" |
| 37 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 38 | ports: |
| 39 | - containerPort: {{ .Values.service.internalPort }} |
| 40 | # disable liveness probe when breakpoints set in debugger |
| 41 | # so K8s doesn't restart unresponsive container |
| 42 | {{- if eq .Values.liveness.enabled true }} |
| 43 | livenessProbe: |
| 44 | tcpSocket: |
| 45 | port: {{ .Values.service.internalPort }} |
| 46 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 47 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 48 | {{ end -}} |
| 49 | readinessProbe: |
| 50 | tcpSocket: |
| 51 | port: {{ .Values.service.internalPort }} |
| 52 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 53 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 54 | env: |
| 55 | - name: SPRING_APPLICATION_JSON |
| 56 | valueFrom: |
| 57 | configMapKeyRef: |
| 58 | name: {{ template "common.fullname" . }} |
| 59 | key: spring_application_json |
| 60 | resources: |
| 61 | {{ toYaml .Values.resources | indent 12 }} |
| 62 | {{- if .Values.nodeSelector }} |
| 63 | nodeSelector: |
| 64 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 65 | {{- end -}} |
| 66 | {{- if .Values.affinity }} |
| 67 | affinity: |
| 68 | {{ toYaml .Values.affinity | indent 10 }} |
| 69 | {{- end }} |
| 70 | imagePullSecrets: |
| 71 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |