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