blob: 5b02c177b5c8d523c71ae211a5ecfe8bc9385585 [file] [log] [blame]
Michael Mokryafae9972019-03-11 14:46:34 -05001apiVersion: 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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +01009 release: {{ include "common.release" . }}
Michael Mokryafae9972019-03-11 14:46:34 -050010 heritage: {{ .Release.Service }}
11spec:
12 replicas: {{ .Values.replicaCount }}
13 template:
14 metadata:
15 labels:
16 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010017 release: {{ include "common.release" . }}
Michael Mokryafae9972019-03-11 14:46:34 -050018 spec:
Michael Mokry3b2647a2019-04-14 20:24:43 -050019 initContainers:
20 - command:
21 - /root/ready.py
22 args:
23 - --container-name
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 - {{ include "common.release" . }}-galera-config
Michael Mokry3b2647a2019-04-14 20:24:43 -050025 env:
26 - name: NAMESPACE
27 valueFrom:
28 fieldRef:
29 apiVersion: v1
30 fieldPath: metadata.namespace
31 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
32 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33 name: {{ include "common.name" . }}-readiness
Michael Mokryafae9972019-03-11 14:46:34 -050034 containers:
35 - name: {{ include "common.name" . }}
36 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
37 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 command: ["/opt/app/policy/pdpx/bin/policy-pdpx.sh"]
jhhbf7fb4d2019-08-07 16:54:41 -050039 args: ["/opt/app/policy/pdpx/etc/mounted/config.json"]
Krzysztof Opasiak7e31efc2020-04-01 00:21:45 +020040 env:
41 - name: SQL_USER
42 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
43 - name: SQL_PASSWORD
44 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
Michael Mokryafae9972019-03-11 14:46:34 -050045 ports:
46 - containerPort: {{ .Values.service.internalPort }}
47 # disable liveness probe when breakpoints set in debugger
48 # so K8s doesn't restart unresponsive container
49 {{- if eq .Values.liveness.enabled true }}
50 livenessProbe:
51 tcpSocket:
52 port: {{ .Values.service.internalPort }}
53 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
54 periodSeconds: {{ .Values.liveness.periodSeconds }}
55 {{ end -}}
56 readinessProbe:
57 tcpSocket:
58 port: {{ .Values.service.internalPort }}
59 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.readiness.periodSeconds }}
61 volumeMounts:
62 - mountPath: /etc/localtime
63 name: localtime
64 readOnly: true
65 - mountPath: /opt/app/policy/pdpx/etc/mounted
66 name: pdpxconfig
67 resources:
68{{ include "common.resources" . | indent 12 }}
69 {{- if .Values.nodeSelector }}
70 nodeSelector:
71{{ toYaml .Values.nodeSelector | indent 10 }}
72 {{- end -}}
73 {{- if .Values.affinity }}
74 affinity:
75{{ toYaml .Values.affinity | indent 10 }}
76 {{- end }}
77 volumes:
78 - name: localtime
79 hostPath:
80 path: /etc/localtime
81 - name: pdpxconfig
82 configMap:
83 name: {{ include "common.fullname" . }}-configmap
84 defaultMode: 0755
85 imagePullSecrets:
86 - name: "{{ include "common.namespace" . }}-docker-registry-key"