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 |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame^] | 29 | resources: |
| 30 | limits: |
| 31 | cpu: "100m" |
| 32 | memory: "0.5Gi" |
| 33 | requests: |
| 34 | cpu: "3m" |
| 35 | memory: "0.02Gi" |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 36 | - command: |
| 37 | - sh |
| 38 | args: |
| 39 | - -c |
Taka Cho | ebd6295 | 2020-10-08 13:50:09 -0400 | [diff] [blame] | 40 | - "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] | 41 | env: |
| 42 | - name: SQL_USER |
Dominik Mizyn | 1103810 | 2020-04-14 17:14:42 +0200 | [diff] [blame] | 43 | {{- 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] | 44 | - name: SQL_PASSWORD |
Dominik Mizyn | 1103810 | 2020-04-14 17:14:42 +0200 | [diff] [blame] | 45 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-creds" "key" "password") | indent 12 }} |
| 46 | - name: RESTSERVER_USER |
| 47 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 12 }} |
| 48 | - name: RESTSERVER_PASSWORD |
| 49 | {{- 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] | 50 | volumeMounts: |
| 51 | - mountPath: /config-input |
| 52 | name: apiconfig |
| 53 | - mountPath: /config |
| 54 | name: apiconfig-processed |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 55 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 56 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 57 | name: {{ include "common.name" . }}-update-config |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 58 | containers: |
| 59 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 60 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 62 | command: ["/opt/app/policy/api/bin/policy-api.sh"] |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 63 | args: ["/opt/app/policy/api/etc/mounted/apiParameters.yaml"] |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 64 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 65 | # disable liveness probe when breakpoints set in debugger |
| 66 | # so K8s doesn't restart unresponsive container |
| 67 | {{- if eq .Values.liveness.enabled true }} |
| 68 | livenessProbe: |
| 69 | tcpSocket: |
| 70 | port: {{ .Values.service.internalPort }} |
| 71 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 72 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 73 | {{ end -}} |
| 74 | readinessProbe: |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 75 | httpGet: |
| 76 | path: {{ .Values.readiness.api }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 77 | port: {{ .Values.service.internalPort }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 78 | httpHeaders: |
| 79 | - name: Authorization |
| 80 | value: Basic {{ printf "%s:%s" .Values.restServer.user .Values.restServer.password | b64enc }} |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 81 | scheme: HTTP |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 82 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 83 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 84 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 85 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 86 | timeoutSeconds: {{ .Values.readiness.timeout }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 87 | volumeMounts: |
| 88 | - mountPath: /etc/localtime |
| 89 | name: localtime |
| 90 | readOnly: true |
| 91 | - mountPath: /opt/app/policy/api/etc/mounted |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 92 | name: apiconfig-processed |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 93 | resources: {{ include "common.resources" . | nindent 12 }} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 94 | {{- if .Values.nodeSelector }} |
| 95 | nodeSelector: |
| 96 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 97 | {{- end -}} |
| 98 | {{- if .Values.affinity }} |
| 99 | affinity: |
| 100 | {{ toYaml .Values.affinity | indent 10 }} |
| 101 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 102 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 103 | volumes: |
| 104 | - name: localtime |
| 105 | hostPath: |
| 106 | path: /etc/localtime |
| 107 | - name: apiconfig |
| 108 | configMap: |
| 109 | name: {{ include "common.fullname" . }}-configmap |
| 110 | defaultMode: 0755 |
Krzysztof Opasiak | 09d1b31 | 2020-03-31 23:44:22 +0200 | [diff] [blame] | 111 | - name: apiconfig-processed |
| 112 | emptyDir: |
| 113 | medium: Memory |
Chenfei Gao | 9292e88 | 2019-02-27 22:14:45 -0500 | [diff] [blame] | 114 | imagePullSecrets: |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 115 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |