Merge "AAF Service Health Check"
[oom.git] / kubernetes / msb / charts / msb-consul / templates / deployment.yaml
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       annotations:
19         sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
20     spec:
21       containers:
22         - name: {{ include "common.name" . }}
23           image: "{{ .Values.global.dockerHubRepository | default .Values.dockerHubRepository }}/{{ .Values.image }}"
24           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
25           ports:
26           - containerPort: {{ .Values.service.internalPort }}
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"