blob: 85ca9c14864b454bbf52231149819758aa6f22ed [file] [log] [blame]
ramverma1a3b8ad2019-02-25 12:45:11 +00001apiVersion: 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" . }}
ramverma1a3b8ad2019-02-25 12:45:11 +000010 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" . }}
ramverma1a3b8ad2019-02-25 12:45:11 +000018 spec:
ramverma6acdabf2019-04-12 18:56:03 +000019 initContainers:
20 - command:
21 - /root/ready.py
22 args:
23 - --container-name
Sylvain Desbureaux4898dc02019-11-14 13:35:13 +010024 - {{ .Values.global.mariadb.service.name }}
ramverma6acdabf2019-04-12 18:56:03 +000025 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
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +020034
35 - command:
36 - sh
37 args:
38 - -c
39 - "export SQL_PASSWORD_BASE64=`echo -n ${SQL_PASSWORD} | base64`; cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
40 env:
41 - name: SQL_USER
42 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
43 - name: SQL_PASSWORD
44 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
45 volumeMounts:
46 - mountPath: /config-input
47 name: papconfig
48 - mountPath: /config
49 name: papconfig-processed
50 image: "{{ .Values.global.envsubstImage }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 name: {{ include "common.name" . }}-update-config
ramverma1a3b8ad2019-02-25 12:45:11 +000053 containers:
54 - name: {{ include "common.name" . }}
55 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 command: ["/opt/app/policy/pap/bin/policy-pap.sh"]
jhhbf7fb4d2019-08-07 16:54:41 -050058 args: ["/opt/app/policy/pap/etc/mounted/config.json"]
ramverma1a3b8ad2019-02-25 12:45:11 +000059 ports:
60 - containerPort: {{ .Values.service.internalPort }}
61 # disable liveness probe when breakpoints set in debugger
62 # so K8s doesn't restart unresponsive container
63 {{- if eq .Values.liveness.enabled true }}
64 livenessProbe:
65 tcpSocket:
66 port: {{ .Values.service.internalPort }}
67 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
68 periodSeconds: {{ .Values.liveness.periodSeconds }}
69 {{ end -}}
70 readinessProbe:
71 tcpSocket:
72 port: {{ .Values.service.internalPort }}
73 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
74 periodSeconds: {{ .Values.readiness.periodSeconds }}
75 volumeMounts:
76 - mountPath: /etc/localtime
77 name: localtime
78 readOnly: true
79 - mountPath: /opt/app/policy/pap/etc/mounted
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +020080 name: papconfig-processed
ramverma1a3b8ad2019-02-25 12:45:11 +000081 resources:
82{{ include "common.resources" . | indent 12 }}
83 {{- if .Values.nodeSelector }}
84 nodeSelector:
85{{ toYaml .Values.nodeSelector | indent 10 }}
86 {{- end -}}
87 {{- if .Values.affinity }}
88 affinity:
89{{ toYaml .Values.affinity | indent 10 }}
90 {{- end }}
91 volumes:
92 - name: localtime
93 hostPath:
94 path: /etc/localtime
95 - name: papconfig
96 configMap:
97 name: {{ include "common.fullname" . }}-configmap
98 defaultMode: 0755
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +020099 - name: papconfig-processed
100 emptyDir:
101 medium: Memory
ramverma1a3b8ad2019-02-25 12:45:11 +0000102 imagePullSecrets:
103 - name: "{{ include "common.namespace" . }}-docker-registry-key"