blob: fb3a90aeae247a0101a4b9f0ae11661e4dca5644 [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 }}
Huabing Zhao81b89762018-07-30 06:33:03 +000018 annotations:
19 sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
BorislavG0433c912018-03-21 18:35:30 +020020 spec:
Huabing Zhao8f7cc812018-08-08 06:27:37 +000021 serviceAccountName: msb
BorislavG0433c912018-03-21 18:35:30 +020022 containers:
23 - name: {{ include "common.name" . }}
24 image: "{{ .Values.global.dockerHubRepository | default .Values.dockerHubRepository }}/{{ .Values.image }}"
25 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
26 ports:
27 - containerPort: {{ .Values.service.internalPort }}
28 # disable liveness probe when breakpoints set in debugger
29 # so K8s doesn't restart unresponsive container
30 {{- if eq .Values.liveness.enabled true }}
31 livenessProbe:
32 tcpSocket:
33 port: {{ .Values.service.internalPort }}
34 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
35 periodSeconds: {{ .Values.liveness.periodSeconds }}
36 {{ end -}}
37 readinessProbe:
38 tcpSocket:
39 port: {{ .Values.service.internalPort }}
40 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
41 periodSeconds: {{ .Values.readiness.periodSeconds }}
42 env:
43 volumeMounts:
44 - mountPath: /etc/localtime
45 name: localtime
46 readOnly: true
47 resources:
48{{ toYaml .Values.resources | indent 12 }}
49 {{- if .Values.nodeSelector }}
50 nodeSelector:
51{{ toYaml .Values.nodeSelector | indent 10 }}
52 {{- end -}}
53 {{- if .Values.affinity }}
54 affinity:
55{{ toYaml .Values.affinity | indent 10 }}
56 {{- end }}
57 volumes:
58 - name: localtime
59 hostPath:
60 path: /etc/localtime
61 imagePullSecrets:
62 - name: "{{ include "common.namespace" . }}-docker-registry-key"