BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [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 | - msb-discovery |
| 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 | name: {{ .Values.service.name }} |
| 41 | - containerPort: {{ .Values.service.internalPortHttps }} |
| 42 | name: {{ .Values.service.name }}-https |
| 43 | # disable liveness probe when breakpoints set in debugger |
| 44 | # so K8s doesn't restart unresponsive container |
| 45 | {{- if eq .Values.liveness.enabled true }} |
| 46 | livenessProbe: |
| 47 | tcpSocket: |
| 48 | port: {{ .Values.service.internalPort }} |
| 49 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 50 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 51 | {{ end -}} |
| 52 | readinessProbe: |
| 53 | tcpSocket: |
| 54 | port: {{ .Values.service.internalPort }} |
| 55 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 56 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 57 | env: |
| 58 | - name: CONSUL_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 59 | value: msb-consul.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 60 | - name: SDCLIENT_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 61 | value: msb-discovery.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 62 | - name: ROUTE_LABELS |
| 63 | value: {{ .Values.config.routeLabels }} |
| 64 | volumeMounts: |
| 65 | - mountPath: /etc/localtime |
| 66 | name: localtime |
| 67 | readOnly: true |
| 68 | resources: |
| 69 | {{ toYaml .Values.resources | indent 12 }} |
| 70 | {{- if .Values.nodeSelector }} |
| 71 | nodeSelector: |
| 72 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 73 | {{- end -}} |
| 74 | {{- if .Values.affinity }} |
| 75 | affinity: |
| 76 | {{ toYaml .Values.affinity | indent 10 }} |
| 77 | {{- end }} |
| 78 | volumes: |
| 79 | - name: localtime |
| 80 | hostPath: |
| 81 | path: /etc/localtime |
| 82 | imagePullSecrets: |
| 83 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |