Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2020 AT&T Intellectual Property. |
| 4 | # ================================================================================ |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # SPDX-License-Identifier: Apache-2.0 |
| 18 | # ============LICENSE_END========================================================= |
Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 19 | */}} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 20 | |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 21 | apiVersion: apps/v1 |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 22 | kind: Deployment |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 23 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 24 | spec: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 25 | selector: {{- include "common.selectors" . | nindent 4 }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 26 | replicas: {{ .Values.replicaCount }} |
| 27 | template: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 28 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 29 | spec: |
Michael Mokry | 3b2647a | 2019-04-14 20:24:43 -0500 | [diff] [blame] | 30 | initContainers: |
| 31 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 32 | - /app/ready.py |
Michael Mokry | 3b2647a | 2019-04-14 20:24:43 -0500 | [diff] [blame] | 33 | args: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 34 | - --job-name |
| 35 | - {{ include "common.release" . }}-policy-galera-config |
Michael Mokry | 3b2647a | 2019-04-14 20:24:43 -0500 | [diff] [blame] | 36 | env: |
| 37 | - name: NAMESPACE |
| 38 | valueFrom: |
| 39 | fieldRef: |
| 40 | apiVersion: v1 |
| 41 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 42 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Michael Mokry | 3b2647a | 2019-04-14 20:24:43 -0500 | [diff] [blame] | 43 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 44 | name: {{ include "common.name" . }}-readiness |
Dominik Mizyn | c88bcc9 | 2020-04-14 18:20:20 +0200 | [diff] [blame] | 45 | - command: |
| 46 | - sh |
| 47 | args: |
| 48 | - -c |
Taka Cho | ebd6295 | 2020-10-08 13:50:09 -0400 | [diff] [blame] | 49 | - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done" |
Dominik Mizyn | c88bcc9 | 2020-04-14 18:20:20 +0200 | [diff] [blame] | 50 | env: |
| 51 | - name: RESTSERVER_USER |
| 52 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }} |
| 53 | - name: RESTSERVER_PASSWORD |
| 54 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }} |
| 55 | - name: API_USER |
| 56 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-creds" "key" "login") | indent 10 }} |
| 57 | - name: API_PASSWORD |
| 58 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-creds" "key" "password") | indent 10 }} |
jhh | ed6839f | 2020-05-08 12:28:27 -0500 | [diff] [blame] | 59 | - name: SQL_USER |
| 60 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
| 61 | - name: SQL_PASSWORD |
| 62 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
Dominik Mizyn | c88bcc9 | 2020-04-14 18:20:20 +0200 | [diff] [blame] | 63 | volumeMounts: |
| 64 | - mountPath: /config-input |
| 65 | name: pdpxconfig |
| 66 | - mountPath: /config |
| 67 | name: pdpxconfig-processed |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 68 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Dominik Mizyn | c88bcc9 | 2020-04-14 18:20:20 +0200 | [diff] [blame] | 69 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 70 | name: {{ include "common.name" . }}-update-config |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 71 | containers: |
| 72 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 73 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 74 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 75 | command: ["/opt/app/policy/pdpx/bin/policy-pdpx.sh"] |
jhh | bf7fb4d | 2019-08-07 16:54:41 -0500 | [diff] [blame] | 76 | args: ["/opt/app/policy/pdpx/etc/mounted/config.json"] |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -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: |
| 89 | tcpSocket: |
| 90 | port: {{ .Values.service.internalPort }} |
| 91 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 92 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 93 | volumeMounts: |
| 94 | - mountPath: /etc/localtime |
| 95 | name: localtime |
| 96 | readOnly: true |
| 97 | - mountPath: /opt/app/policy/pdpx/etc/mounted |
Dominik Mizyn | c88bcc9 | 2020-04-14 18:20:20 +0200 | [diff] [blame] | 98 | name: pdpxconfig-processed |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 99 | resources: {{ include "common.resources" . | nindent 12 }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 100 | {{- if .Values.nodeSelector }} |
| 101 | nodeSelector: |
| 102 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 103 | {{- end -}} |
| 104 | {{- if .Values.affinity }} |
| 105 | affinity: |
| 106 | {{ toYaml .Values.affinity | indent 10 }} |
| 107 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 108 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 109 | volumes: |
| 110 | - name: localtime |
| 111 | hostPath: |
| 112 | path: /etc/localtime |
| 113 | - name: pdpxconfig |
| 114 | configMap: |
| 115 | name: {{ include "common.fullname" . }}-configmap |
| 116 | defaultMode: 0755 |
Dominik Mizyn | c88bcc9 | 2020-04-14 18:20:20 +0200 | [diff] [blame] | 117 | - name: pdpxconfig-processed |
| 118 | emptyDir: |
| 119 | medium: Memory |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 120 | imagePullSecrets: |
| 121 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |