ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [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" . }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [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" . }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 18 | spec: |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 19 | initContainers: |
| 20 | - command: |
| 21 | - /root/ready.py |
| 22 | args: |
| 23 | - --container-name |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 24 | - {{ .Values.global.mariadb.service.name }} |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 25 | 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 Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 34 | |
| 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 }} |
Dominik Mizyn | 389fca1 | 2020-04-09 22:37:00 +0200 | [diff] [blame^] | 45 | - name: RESTSERVER_USER |
| 46 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "login") | indent 10 }} |
| 47 | - name: RESTSERVER_PASSWORD |
| 48 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "password") | indent 10 }} |
| 49 | - name: API_USER |
| 50 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "login") | indent 10 }} |
| 51 | - name: API_PASSWORD |
| 52 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "password") | indent 10 }} |
| 53 | - name: DISTRIBUTION_USER |
| 54 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "distribution-secret" "key" "login") | indent 10 }} |
| 55 | - name: DISTRIBUTION_PASSWORD |
| 56 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "distribution-secret" "key" "password") | indent 10 }} |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 57 | volumeMounts: |
| 58 | - mountPath: /config-input |
| 59 | name: papconfig |
| 60 | - mountPath: /config |
| 61 | name: papconfig-processed |
| 62 | image: "{{ .Values.global.envsubstImage }}" |
| 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 64 | name: {{ include "common.name" . }}-update-config |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 65 | containers: |
| 66 | - name: {{ include "common.name" . }} |
| 67 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 68 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 69 | command: ["/opt/app/policy/pap/bin/policy-pap.sh"] |
jhh | bf7fb4d | 2019-08-07 16:54:41 -0500 | [diff] [blame] | 70 | args: ["/opt/app/policy/pap/etc/mounted/config.json"] |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 71 | ports: |
| 72 | - containerPort: {{ .Values.service.internalPort }} |
| 73 | # disable liveness probe when breakpoints set in debugger |
| 74 | # so K8s doesn't restart unresponsive container |
| 75 | {{- if eq .Values.liveness.enabled true }} |
| 76 | livenessProbe: |
| 77 | tcpSocket: |
| 78 | port: {{ .Values.service.internalPort }} |
| 79 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 80 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 81 | {{ end -}} |
| 82 | readinessProbe: |
| 83 | tcpSocket: |
| 84 | port: {{ .Values.service.internalPort }} |
| 85 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 86 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 87 | volumeMounts: |
| 88 | - mountPath: /etc/localtime |
| 89 | name: localtime |
| 90 | readOnly: true |
| 91 | - mountPath: /opt/app/policy/pap/etc/mounted |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 92 | name: papconfig-processed |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 93 | resources: |
| 94 | {{ include "common.resources" . | indent 12 }} |
| 95 | {{- if .Values.nodeSelector }} |
| 96 | nodeSelector: |
| 97 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 98 | {{- end -}} |
| 99 | {{- if .Values.affinity }} |
| 100 | affinity: |
| 101 | {{ toYaml .Values.affinity | indent 10 }} |
| 102 | {{- end }} |
| 103 | volumes: |
| 104 | - name: localtime |
| 105 | hostPath: |
| 106 | path: /etc/localtime |
| 107 | - name: papconfig |
| 108 | configMap: |
| 109 | name: {{ include "common.fullname" . }}-configmap |
| 110 | defaultMode: 0755 |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 111 | - name: papconfig-processed |
| 112 | emptyDir: |
| 113 | medium: Memory |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 114 | imagePullSecrets: |
| 115 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |