Add Common Helm Chart "mariadb-galera"
[oom.git] / kubernetes / sdc / charts / sdc-cs / 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.repository | default .Values.repository }}/{{ .Values.image }}"
22           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
23           ports:
24           - containerPort: {{ .Values.service.internalPort }}
25           - containerPort: {{ .Values.service.internalPort2 }}
26           # disable liveness probe when breakpoints set in debugger
27           # so K8s doesn't restart unresponsive container
28           {{- if eq .Values.liveness.enabled true }}
29           livenessProbe:
30             tcpSocket:
31               port: {{ .Values.service.internalPort }}
32             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
33             periodSeconds: {{ .Values.liveness.periodSeconds }}
34           {{ end -}}
35           readinessProbe:
36             tcpSocket:
37               port: {{ .Values.service.internalPort }}
38             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
39             periodSeconds: {{ .Values.readiness.periodSeconds }}
40           env:
41           - name: ENVNAME
42             value: {{ .Values.global.env.name }}
43           - name: HOST_IP
44             valueFrom:
45               fieldRef:
46                 fieldPath: status.podIP
47           - name: CS_PASSWORD
48             valueFrom:
49               secretKeyRef: {name: {{ include "common.fullname" . }}, key: cs_password}
50           volumeMounts:
51           - name: {{ include "common.fullname" . }}-data
52             mountPath: /var/lib/cassandra/
53           - name: {{ include "common.fullname" . }}-environments
54             mountPath: /root/chef-solo/environments/
55           - name: {{ include "common.fullname" . }}-localtime
56             mountPath: /etc/localtime
57             readOnly: true
58           - name: {{ include "common.fullname" . }}-logs
59             mountPath: /var/lib/jetty/logs
60           resources:
61 {{ toYaml .Values.resources | indent 12 }}
62         {{- if .Values.nodeSelector }}
63         nodeSelector:
64 {{ toYaml .Values.nodeSelector | indent 10 }}
65         {{- end -}}
66         {{- if .Values.affinity }}
67         affinity:
68 {{ toYaml .Values.affinity | indent 10 }}
69         {{- end }}
70       volumes:
71         - name: {{ include "common.fullname" . }}-localtime
72           hostPath:
73             path: /etc/localtime
74         - name: {{ include "common.fullname" . }}-logs
75           emptyDir: {}
76       {{- if .Values.persistence.enabled }}
77         - name: {{ include "common.fullname" . }}-data
78           persistentVolumeClaim:
79             claimName: {{ include "common.fullname" . }}
80       {{- else }}
81           emptyDir: {}
82       {{- end }}
83         - name: {{ include "common.fullname" . }}-environments
84           configMap:
85             name: {{ .Release.Name }}-sdc-environments-configmap
86             defaultMode: 0755
87       imagePullSecrets:
88       - name: "{{ include "common.namespace" . }}-docker-registry-key"