mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 1 | apiVersion: extensions/v1beta1 |
| 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: |
| 12 | replicas: {{ .Values.replicaCount }} |
| 13 | template: |
| 14 | metadata: |
| 15 | labels: |
| 16 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 17 | release: {{ include "common.release" . }} |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 18 | spec: |
Dominik Mizyn | 4aa534f | 2020-04-14 18:03:53 +0200 | [diff] [blame] | 19 | 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 |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 50 | containers: |
| 51 | - name: {{ include "common.name" . }} |
Julien Barbot | 665fdc1 | 2018-10-22 16:49:07 +0200 | [diff] [blame] | 52 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 53 | 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 Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 79 | {{ include "common.resources" . | indent 12 }} |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 80 | {{- 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 Mizyn | 4aa534f | 2020-04-14 18:03:53 +0200 | [diff] [blame] | 92 | - name: distributionconfig-input |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 93 | configMap: |
| 94 | name: {{ include "common.fullname" . }}-configmap |
| 95 | defaultMode: 0755 |
Dominik Mizyn | 4aa534f | 2020-04-14 18:03:53 +0200 | [diff] [blame] | 96 | - name: distributionconfig |
| 97 | emptyDir: |
| 98 | medium: Memory |
mmis | 9cb5029 | 2018-09-19 00:31:35 +0100 | [diff] [blame] | 99 | imagePullSecrets: |
| 100 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |