ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 1 | apiVersion: extensions/v1beta1 |
| 2 | kind: Deployment |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame^] | 3 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 4 | spec: |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame^] | 5 | selector: {{- include "common.selectors" . | nindent 4 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 6 | replicas: {{ .Values.replicaCount }} |
| 7 | template: |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame^] | 8 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 9 | spec: |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 10 | initContainers: |
| 11 | - command: |
| 12 | - /root/ready.py |
| 13 | args: |
| 14 | - --container-name |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 15 | - {{ .Values.global.mariadb.service.name }} |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 16 | env: |
| 17 | - name: NAMESPACE |
| 18 | valueFrom: |
| 19 | fieldRef: |
| 20 | apiVersion: v1 |
| 21 | fieldPath: metadata.namespace |
| 22 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 23 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 24 | name: {{ include "common.name" . }}-readiness |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 25 | |
| 26 | - command: |
| 27 | - sh |
| 28 | args: |
| 29 | - -c |
| 30 | - "export SQL_PASSWORD_BASE64=`echo -n ${SQL_PASSWORD} | base64`; cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 31 | env: |
| 32 | - name: SQL_USER |
| 33 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
| 34 | - name: SQL_PASSWORD |
| 35 | {{- 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] | 36 | - name: RESTSERVER_USER |
| 37 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "login") | indent 10 }} |
| 38 | - name: RESTSERVER_PASSWORD |
| 39 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "password") | indent 10 }} |
| 40 | - name: API_USER |
| 41 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "login") | indent 10 }} |
| 42 | - name: API_PASSWORD |
| 43 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "password") | indent 10 }} |
| 44 | - name: DISTRIBUTION_USER |
| 45 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "distribution-secret" "key" "login") | indent 10 }} |
| 46 | - name: DISTRIBUTION_PASSWORD |
| 47 | {{- 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] | 48 | volumeMounts: |
| 49 | - mountPath: /config-input |
| 50 | name: papconfig |
| 51 | - mountPath: /config |
| 52 | name: papconfig-processed |
| 53 | image: "{{ .Values.global.envsubstImage }}" |
| 54 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 55 | name: {{ include "common.name" . }}-update-config |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 56 | containers: |
| 57 | - name: {{ include "common.name" . }} |
| 58 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 59 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 60 | command: ["/opt/app/policy/pap/bin/policy-pap.sh"] |
jhh | bf7fb4d | 2019-08-07 16:54:41 -0500 | [diff] [blame] | 61 | args: ["/opt/app/policy/pap/etc/mounted/config.json"] |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame^] | 62 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 63 | # disable liveness probe when breakpoints set in debugger |
| 64 | # so K8s doesn't restart unresponsive container |
| 65 | {{- if eq .Values.liveness.enabled true }} |
| 66 | livenessProbe: |
| 67 | tcpSocket: |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame^] | 68 | port: {{ .Values.liveness.port }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 69 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 70 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 71 | {{ end -}} |
| 72 | readinessProbe: |
| 73 | tcpSocket: |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame^] | 74 | port: {{ .Values.readiness.port }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 75 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 76 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 77 | volumeMounts: |
| 78 | - mountPath: /etc/localtime |
| 79 | name: localtime |
| 80 | readOnly: true |
| 81 | - mountPath: /opt/app/policy/pap/etc/mounted |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 82 | name: papconfig-processed |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 83 | resources: |
| 84 | {{ include "common.resources" . | indent 12 }} |
| 85 | {{- if .Values.nodeSelector }} |
| 86 | nodeSelector: |
| 87 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 88 | {{- end -}} |
| 89 | {{- if .Values.affinity }} |
| 90 | affinity: |
| 91 | {{ toYaml .Values.affinity | indent 10 }} |
| 92 | {{- end }} |
| 93 | volumes: |
| 94 | - name: localtime |
| 95 | hostPath: |
| 96 | path: /etc/localtime |
| 97 | - name: papconfig |
| 98 | configMap: |
| 99 | name: {{ include "common.fullname" . }}-configmap |
| 100 | defaultMode: 0755 |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 101 | - name: papconfig-processed |
| 102 | emptyDir: |
| 103 | medium: Memory |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 104 | imagePullSecrets: |
| 105 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |