blob: 8301df1c7844a3ccf182d82e7d9a7c94dc4709a3 [file] [log] [blame]
Grzegorz-Lis4fad3022020-07-31 10:18:21 +02001apiVersion: apps/v1
mmis9cb50292018-09-19 00:31:35 +01002kind: 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:
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020012 selector:
13 matchLabels:
14 app: {{ include "common.name" . }}
mmis9cb50292018-09-19 00:31:35 +010015 replicas: {{ .Values.replicaCount }}
16 template:
17 metadata:
18 labels:
19 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010020 release: {{ include "common.release" . }}
mmis9cb50292018-09-19 00:31:35 +010021 spec:
Dominik Mizyn4aa534f2020-04-14 18:03:53 +020022 initContainers:
23 - command:
24 - sh
25 args:
26 - -c
27 - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done"
28 env:
29 - name: RESTSERVER_USER
30 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }}
31 - name: RESTSERVER_PASSWORD
32 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }}
33 - name: API_USER
34 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "apiparameters-creds" "key" "login") | indent 10 }}
35 - name: API_PASSWORD
36 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "apiparameters-creds" "key" "password") | indent 10 }}
37 - name: PAP_USER
38 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "papparameters-creds" "key" "login") | indent 10 }}
39 - name: PAP_PASSWORD
40 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "papparameters-creds" "key" "password") | indent 10 }}
41 - name: SDCBE_USER
42 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdcbe-creds" "key" "login") | indent 10 }}
43 - name: SDCBE_PASSWORD
44 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdcbe-creds" "key" "password") | indent 10 }}
45 volumeMounts:
46 - mountPath: /config-input
47 name: distributionconfig-input
48 - mountPath: /config
49 name: distributionconfig
50 image: "{{ .Values.global.envsubstImage }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 name: {{ include "common.name" . }}-update-config
mmis9cb50292018-09-19 00:31:35 +010053 containers:
54 - name: {{ include "common.name" . }}
Julien Barbot665fdc12018-10-22 16:49:07 +020055 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mmis9cb50292018-09-19 00:31:35 +010056 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 command: ["/opt/app/policy/distribution/bin/policy-dist.sh"]
58 args: ["/opt/app/policy/distribution/etc/mounted/config.json"]
59 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/distribution/etc/mounted
80 name: distributionconfig
81 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000082{{ include "common.resources" . | indent 12 }}
mmis9cb50292018-09-19 00:31:35 +010083 {{- 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
Dominik Mizyn4aa534f2020-04-14 18:03:53 +020095 - name: distributionconfig-input
mmis9cb50292018-09-19 00:31:35 +010096 configMap:
97 name: {{ include "common.fullname" . }}-configmap
98 defaultMode: 0755
Dominik Mizyn4aa534f2020-04-14 18:03:53 +020099 - name: distributionconfig
100 emptyDir:
101 medium: Memory
mmis9cb50292018-09-19 00:31:35 +0100102 imagePullSecrets:
103 - name: "{{ include "common.namespace" . }}-docker-registry-key"