Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 1 | apiVersion: apps/v1 |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [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" . }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [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" . }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [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" . }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 21 | spec: |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 22 | initContainers: |
| 23 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 24 | - /app/ready.py |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 25 | args: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 26 | - --job-name |
| 27 | - {{ include "common.release" . }}-policy-galera-config |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 28 | env: |
| 29 | - name: NAMESPACE |
| 30 | valueFrom: |
| 31 | fieldRef: |
| 32 | apiVersion: v1 |
| 33 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 34 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 35 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 36 | name: {{ include "common.name" . }}-readiness |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 37 | - command: |
| 38 | - sh |
| 39 | args: |
| 40 | - -c |
Taka Cho | ebd6295 | 2020-10-08 13:50:09 -0400 | [diff] [blame] | 41 | - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done" |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 42 | env: |
| 43 | - name: SQL_USER |
Dominik Mizyn | 1103810 | 2020-04-14 17:14:42 +0200 | [diff] [blame] | 44 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-creds" "key" "login") | indent 12 }} |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 45 | - name: SQL_PASSWORD |
Dominik Mizyn | 1103810 | 2020-04-14 17:14:42 +0200 | [diff] [blame] | 46 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-creds" "key" "password") | indent 12 }} |
| 47 | - name: RESTSERVER_USER |
| 48 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 12 }} |
| 49 | - name: RESTSERVER_PASSWORD |
| 50 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 12 }} |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 51 | volumeMounts: |
| 52 | - mountPath: /config-input |
| 53 | name: apiconfig |
| 54 | - mountPath: /config |
| 55 | name: apiconfig-processed |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 56 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 57 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 58 | name: {{ include "common.name" . }}-update-config |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 59 | {{ include "common.certInitializer.initContainer" . | indent 8 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 60 | containers: |
| 61 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 62 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 64 | {{- if .Values.global.aafEnabled }} |
Taka Cho | 9658ce8 | 2020-12-10 14:34:18 -0500 | [diff] [blame] | 65 | command: ["sh","-c"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 66 | args: ["source {{ .Values.certInitializer.credsPath }}/.ci;\ |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 67 | /opt/app/policy/api/bin/policy-api.sh /opt/app/policy/api/etc/mounted/apiParameters.yaml"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 68 | {{- else }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 69 | command: ["/opt/app/policy/api/bin/policy-api.sh"] |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 70 | args: ["/opt/app/policy/api/etc/mounted/apiParameters.yaml"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 71 | env: |
| 72 | - name: KEYSTORE_PASSWD |
| 73 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 12 }} |
| 74 | - name: TRUSTSTORE_PASSWD |
| 75 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 12 }} |
| 76 | {{- end }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 77 | ports: |
| 78 | - containerPort: {{ .Values.service.internalPort }} |
| 79 | # disable liveness probe when breakpoints set in debugger |
| 80 | # so K8s doesn't restart unresponsive container |
| 81 | {{- if eq .Values.liveness.enabled true }} |
| 82 | livenessProbe: |
| 83 | tcpSocket: |
| 84 | port: {{ .Values.service.internalPort }} |
| 85 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 86 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 87 | {{ end -}} |
| 88 | readinessProbe: |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 89 | httpGet: |
| 90 | path: {{ .Values.readiness.api }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 91 | port: {{ .Values.service.internalPort }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 92 | httpHeaders: |
| 93 | - name: Authorization |
| 94 | value: Basic {{ printf "%s:%s" .Values.restServer.user .Values.restServer.password | b64enc }} |
| 95 | scheme: {{ .Values.readiness.scheme }} |
| 96 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 97 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 98 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 99 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 100 | timeoutSeconds: {{ .Values.readiness.timeout }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 101 | volumeMounts: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 102 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 103 | - mountPath: /etc/localtime |
| 104 | name: localtime |
| 105 | readOnly: true |
| 106 | - mountPath: /opt/app/policy/api/etc/mounted |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 107 | name: apiconfig-processed |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 108 | resources: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 109 | {{ include "common.resources" . }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 110 | {{- if .Values.nodeSelector }} |
| 111 | nodeSelector: |
| 112 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 113 | {{- end -}} |
| 114 | {{- if .Values.affinity }} |
| 115 | affinity: |
| 116 | {{ toYaml .Values.affinity | indent 10 }} |
| 117 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 118 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 119 | volumes: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 120 | {{ include "common.certInitializer.volumes" . | indent 8 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 121 | - name: localtime |
| 122 | hostPath: |
| 123 | path: /etc/localtime |
| 124 | - name: apiconfig |
| 125 | configMap: |
| 126 | name: {{ include "common.fullname" . }}-configmap |
| 127 | defaultMode: 0755 |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 128 | - name: apiconfig-processed |
| 129 | emptyDir: |
| 130 | medium: Memory |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 131 | imagePullSecrets: |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 132 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |