Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame^] | 1 | apiVersion: apps/v1 |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 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 "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 9 | release: {{ include "common.release" . }} |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 10 | heritage: {{ .Release.Service }} |
| 11 | spec: |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame^] | 12 | selector: |
| 13 | matchLabels: |
| 14 | app: {{ include "common.name" . }} |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 15 | replicas: {{ .Values.replicaCount }} |
| 16 | template: |
| 17 | metadata: |
| 18 | labels: |
| 19 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 20 | release: {{ include "common.release" . }} |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 21 | spec: |
Dominik Mizyn | 4aa534f | 2020-04-14 18:03:53 +0200 | [diff] [blame] | 22 | 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 |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 53 | containers: |
| 54 | - name: {{ include "common.name" . }} |
Julien Barbot | 665fdc1 | 2018-10-22 16:49:07 +0200 | [diff] [blame] | 55 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 56 | 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 Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 82 | {{ include "common.resources" . | indent 12 }} |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 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 |
Dominik Mizyn | 4aa534f | 2020-04-14 18:03:53 +0200 | [diff] [blame] | 95 | - name: distributionconfig-input |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 96 | configMap: |
| 97 | name: {{ include "common.fullname" . }}-configmap |
| 98 | defaultMode: 0755 |
Dominik Mizyn | 4aa534f | 2020-04-14 18:03:53 +0200 | [diff] [blame] | 99 | - name: distributionconfig |
| 100 | emptyDir: |
| 101 | medium: Memory |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 102 | imagePullSecrets: |
| 103 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |