Create Service Account for MSB
[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       serviceAccountName: msb
22       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"