blob: 2df82aca590024f09b4a00e956b99747baf86c7f [file] [log] [blame]
BorislavG0433c912018-03-21 18:35:30 +02001apiVersion: extensions/v1beta1
2kind: Deployment
3metadata:
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 }}
11spec:
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
BorislavG6c7ecf02018-04-01 13:08:37 +030059 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020060 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030061 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020062 - 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"