blob: b3b017acd335943f5c83e8804c2438131f21b8fd [file] [log] [blame]
mmis9cb50292018-09-19 00:31:35 +01001apiVersion: 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" . }}
mmis9cb50292018-09-19 00:31:35 +010010 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" . }}
mmis9cb50292018-09-19 00:31:35 +010018 spec:
Dominik Mizyn4aa534f2020-04-14 18:03:53 +020019 initContainers:
20 - command:
21 - sh
22 args:
23 - -c
24 - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done"
25 env:
26 - name: RESTSERVER_USER
27 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }}
28 - name: RESTSERVER_PASSWORD
29 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }}
30 - name: API_USER
31 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "apiparameters-creds" "key" "login") | indent 10 }}
32 - name: API_PASSWORD
33 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "apiparameters-creds" "key" "password") | indent 10 }}
34 - name: PAP_USER
35 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "papparameters-creds" "key" "login") | indent 10 }}
36 - name: PAP_PASSWORD
37 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "papparameters-creds" "key" "password") | indent 10 }}
38 - name: SDCBE_USER
39 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdcbe-creds" "key" "login") | indent 10 }}
40 - name: SDCBE_PASSWORD
41 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdcbe-creds" "key" "password") | indent 10 }}
42 volumeMounts:
43 - mountPath: /config-input
44 name: distributionconfig-input
45 - mountPath: /config
46 name: distributionconfig
47 image: "{{ .Values.global.envsubstImage }}"
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49 name: {{ include "common.name" . }}-update-config
mmis9cb50292018-09-19 00:31:35 +010050 containers:
51 - name: {{ include "common.name" . }}
Julien Barbot665fdc12018-10-22 16:49:07 +020052 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mmis9cb50292018-09-19 00:31:35 +010053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 command: ["/opt/app/policy/distribution/bin/policy-dist.sh"]
55 args: ["/opt/app/policy/distribution/etc/mounted/config.json"]
56 ports:
57 - containerPort: {{ .Values.service.internalPort }}
58 # disable liveness probe when breakpoints set in debugger
59 # so K8s doesn't restart unresponsive container
60 {{- if eq .Values.liveness.enabled true }}
61 livenessProbe:
62 tcpSocket:
63 port: {{ .Values.service.internalPort }}
64 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.liveness.periodSeconds }}
66 {{ end -}}
67 readinessProbe:
68 tcpSocket:
69 port: {{ .Values.service.internalPort }}
70 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
71 periodSeconds: {{ .Values.readiness.periodSeconds }}
72 volumeMounts:
73 - mountPath: /etc/localtime
74 name: localtime
75 readOnly: true
76 - mountPath: /opt/app/policy/distribution/etc/mounted
77 name: distributionconfig
78 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000079{{ include "common.resources" . | indent 12 }}
mmis9cb50292018-09-19 00:31:35 +010080 {{- if .Values.nodeSelector }}
81 nodeSelector:
82{{ toYaml .Values.nodeSelector | indent 10 }}
83 {{- end -}}
84 {{- if .Values.affinity }}
85 affinity:
86{{ toYaml .Values.affinity | indent 10 }}
87 {{- end }}
88 volumes:
89 - name: localtime
90 hostPath:
91 path: /etc/localtime
Dominik Mizyn4aa534f2020-04-14 18:03:53 +020092 - name: distributionconfig-input
mmis9cb50292018-09-19 00:31:35 +010093 configMap:
94 name: {{ include "common.fullname" . }}-configmap
95 defaultMode: 0755
Dominik Mizyn4aa534f2020-04-14 18:03:53 +020096 - name: distributionconfig
97 emptyDir:
98 medium: Memory
mmis9cb50292018-09-19 00:31:35 +010099 imagePullSecrets:
100 - name: "{{ include "common.namespace" . }}-docker-registry-key"