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 |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 3 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 4 | spec: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 5 | selector: {{- include "common.selectors" . | nindent 4 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 6 | replicas: {{ .Values.replicaCount }} |
| 7 | template: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 8 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 9 | spec: |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 10 | initContainers: |
| 11 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 12 | - /app/ready.py |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 13 | args: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 14 | - --job-name |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 15 | {{ if not .Values.global.postgres.localCluster }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 16 | - {{ include "common.release" . }}-policy-galera-config |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 17 | {{ else }} |
| 18 | - {{ include "common.release" . }}-policy-pg-config |
| 19 | {{ end }} |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 20 | env: |
| 21 | - name: NAMESPACE |
| 22 | valueFrom: |
| 23 | fieldRef: |
| 24 | apiVersion: v1 |
| 25 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 26 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Chenfei Gao | 8fdac3a | 2019-04-12 14:39:40 -0400 | [diff] [blame] | 27 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 28 | name: {{ include "common.name" . }}-readiness |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 29 | - command: |
| 30 | - sh |
| 31 | args: |
| 32 | - -c |
Taka Cho | ebd6295 | 2020-10-08 13:50:09 -0400 | [diff] [blame] | 33 | - "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] | 34 | env: |
| 35 | - name: SQL_USER |
Dominik Mizyn | 1103810 | 2020-04-14 17:14:42 +0200 | [diff] [blame] | 36 | {{- 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] | 37 | - name: SQL_PASSWORD |
Dominik Mizyn | 1103810 | 2020-04-14 17:14:42 +0200 | [diff] [blame] | 38 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-creds" "key" "password") | indent 12 }} |
| 39 | - name: RESTSERVER_USER |
| 40 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 12 }} |
| 41 | - name: RESTSERVER_PASSWORD |
| 42 | {{- 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] | 43 | volumeMounts: |
| 44 | - mountPath: /config-input |
| 45 | name: apiconfig |
| 46 | - mountPath: /config |
| 47 | name: apiconfig-processed |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 48 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 49 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 50 | name: {{ include "common.name" . }}-update-config |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 51 | containers: |
| 52 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 53 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 54 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 55 | command: ["/opt/app/policy/api/bin/policy-api.sh"] |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 56 | args: ["/opt/app/policy/api/etc/mounted/apiParameters.yaml"] |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 57 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 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: |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 68 | httpGet: |
| 69 | path: {{ .Values.readiness.api }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 70 | port: {{ .Values.service.internalPort }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 71 | httpHeaders: |
| 72 | - name: Authorization |
| 73 | value: Basic {{ printf "%s:%s" .Values.restServer.user .Values.restServer.password | b64enc }} |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 74 | scheme: HTTP |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 75 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 76 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 77 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 78 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 79 | timeoutSeconds: {{ .Values.readiness.timeout }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 80 | volumeMounts: |
| 81 | - mountPath: /etc/localtime |
| 82 | name: localtime |
| 83 | readOnly: true |
| 84 | - mountPath: /opt/app/policy/api/etc/mounted |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 85 | name: apiconfig-processed |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 86 | resources: {{ include "common.resources" . | nindent 12 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 87 | {{- if .Values.nodeSelector }} |
| 88 | nodeSelector: |
| 89 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 90 | {{- end -}} |
| 91 | {{- if .Values.affinity }} |
| 92 | affinity: |
| 93 | {{ toYaml .Values.affinity | indent 10 }} |
| 94 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 95 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 96 | volumes: |
| 97 | - name: localtime |
| 98 | hostPath: |
| 99 | path: /etc/localtime |
| 100 | - name: apiconfig |
| 101 | configMap: |
| 102 | name: {{ include "common.fullname" . }}-configmap |
| 103 | defaultMode: 0755 |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 104 | - name: apiconfig-processed |
| 105 | emptyDir: |
| 106 | medium: Memory |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 107 | imagePullSecrets: |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 108 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |