BorislavG | 12b6158 | 2018-03-28 19:31:32 +0300 | [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 | containers: |
| 21 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 22 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
BorislavG | 12b6158 | 2018-03-28 19:31:32 +0300 | [diff] [blame] | 23 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 24 | ports: |
| 25 | - containerPort: {{ .Values.service.internalPort }} |
| 26 | name: {{ .Values.service.name }} |
| 27 | # disable liveness probe when breakpoints set in debugger |
| 28 | # so K8s doesn't restart unresponsive container |
| 29 | {{- if eq .Values.liveness.enabled true }} |
| 30 | livenessProbe: |
| 31 | tcpSocket: |
| 32 | port: {{ .Values.service.internalPort }} |
| 33 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 34 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 35 | {{ end -}} |
| 36 | readinessProbe: |
| 37 | tcpSocket: |
| 38 | port: {{ .Values.service.internalPort }} |
| 39 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 40 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 41 | env: |
| 42 | volumeMounts: |
| 43 | - mountPath: /etc/localtime |
| 44 | name: localtime |
| 45 | readOnly: true |
| 46 | resources: |
| 47 | {{ toYaml .Values.resources | indent 12 }} |
| 48 | {{- if .Values.nodeSelector }} |
| 49 | nodeSelector: |
| 50 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 51 | {{- end -}} |
| 52 | {{- if .Values.affinity }} |
| 53 | affinity: |
| 54 | {{ toYaml .Values.affinity | indent 10 }} |
| 55 | {{- end }} |
| 56 | volumes: |
| 57 | - name: localtime |
| 58 | hostPath: |
| 59 | path: /etc/localtime |
| 60 | imagePullSecrets: |
| 61 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |