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. |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 4 | # Modifications Copyright (C) 2022 Bell Canada. All rights reserved. |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 5 | # ================================================================================ |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ============LICENSE_END========================================================= |
Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 20 | */}} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 21 | |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 22 | apiVersion: apps/v1 |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 23 | kind: Deployment |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame] | 24 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 25 | spec: |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame] | 26 | selector: {{- include "common.selectors" . | nindent 4 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 27 | replicas: {{ .Values.replicaCount }} |
| 28 | template: |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame] | 29 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 30 | spec: |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 31 | initContainers: |
| 32 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 33 | - /app/ready.py |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 34 | args: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 35 | - --job-name |
| 36 | - {{ include "common.release" . }}-policy-galera-config |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 37 | env: |
| 38 | - name: NAMESPACE |
| 39 | valueFrom: |
| 40 | fieldRef: |
| 41 | apiVersion: v1 |
| 42 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 43 | image: {{ include "repositoryGenerator.image.readiness" . }} |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 44 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 45 | name: {{ include "common.name" . }}-readiness |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 46 | - command: |
| 47 | - sh |
| 48 | args: |
| 49 | - -c |
Taka Cho | ebd6295 | 2020-10-08 13:50:09 -0400 | [diff] [blame] | 50 | - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done" |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 51 | env: |
| 52 | - name: SQL_USER |
| 53 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
| 54 | - name: SQL_PASSWORD |
| 55 | {{- 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] | 56 | - name: RESTSERVER_USER |
| 57 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "login") | indent 10 }} |
| 58 | - name: RESTSERVER_PASSWORD |
| 59 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "password") | indent 10 }} |
| 60 | - name: API_USER |
| 61 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "login") | indent 10 }} |
| 62 | - name: API_PASSWORD |
| 63 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "password") | indent 10 }} |
| 64 | - name: DISTRIBUTION_USER |
| 65 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "distribution-secret" "key" "login") | indent 10 }} |
| 66 | - name: DISTRIBUTION_PASSWORD |
| 67 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "distribution-secret" "key" "password") | indent 10 }} |
Sirisha_Manchikanti | 73c5f00 | 2022-07-25 17:04:45 +0100 | [diff] [blame] | 68 | {{- if .Values.config.useStrimziKafka }} |
| 69 | - name: JAASLOGIN |
| 70 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-kafka-user" "key" "sasl.jaas.config") | indent 10 }} |
| 71 | {{- end }} |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 72 | volumeMounts: |
| 73 | - mountPath: /config-input |
| 74 | name: papconfig |
| 75 | - mountPath: /config |
| 76 | name: papconfig-processed |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 77 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 78 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 79 | name: {{ include "common.name" . }}-update-config |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 80 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 81 | containers: |
| 82 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 83 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 84 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 85 | {{- if .Values.global.aafEnabled }} |
Taka Cho | 9658ce8 | 2020-12-10 14:34:18 -0500 | [diff] [blame] | 86 | command: ["sh","-c"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 87 | args: ["source {{ .Values.certInitializer.credsPath }}/.ci;\ |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 88 | /opt/app/policy/pap/bin/policy-pap.sh /opt/app/policy/pap/etc/mounted/papParameters.yaml"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 89 | {{- else }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 90 | command: ["/opt/app/policy/pap/bin/policy-pap.sh"] |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 91 | args: ["/opt/app/policy/pap/etc/mounted/papParameters.yaml"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 92 | env: |
| 93 | - name: KEYSTORE_PASSWD |
| 94 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 12 }} |
| 95 | - name: TRUSTSTORE_PASSWD |
| 96 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 12 }} |
| 97 | {{- end }} |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame] | 98 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 99 | # disable liveness probe when breakpoints set in debugger |
| 100 | # so K8s doesn't restart unresponsive container |
| 101 | {{- if eq .Values.liveness.enabled true }} |
| 102 | livenessProbe: |
| 103 | tcpSocket: |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame] | 104 | port: {{ .Values.liveness.port }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 105 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 106 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 107 | {{ end -}} |
| 108 | readinessProbe: |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 109 | httpGet: |
| 110 | path: {{ .Values.readiness.api }} |
Bruno Sakoto | 0644c26 | 2020-05-22 16:56:35 -0400 | [diff] [blame] | 111 | port: {{ .Values.readiness.port }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 112 | httpHeaders: |
| 113 | - name: Authorization |
| 114 | value: Basic {{ printf "%s:%s" .Values.restServer.user .Values.restServer.password | b64enc }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 115 | scheme: {{ (eq "true" (include "common.needTLS" .)) | ternary "HTTPS" "HTTP" }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 116 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 117 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 118 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 119 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
a.sreekumar | 2f37736 | 2022-02-09 12:40:57 +0000 | [diff] [blame] | 120 | timeoutSeconds: {{ .Values.readiness.timeout }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 121 | volumeMounts: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 122 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 123 | - mountPath: /etc/localtime |
| 124 | name: localtime |
| 125 | readOnly: true |
| 126 | - mountPath: /opt/app/policy/pap/etc/mounted |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 127 | name: papconfig-processed |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame^] | 128 | resources: {{ include "common.resources" . | nindent 12 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 129 | {{- if .Values.nodeSelector }} |
| 130 | nodeSelector: |
| 131 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 132 | {{- end -}} |
| 133 | {{- if .Values.affinity }} |
| 134 | affinity: |
| 135 | {{ toYaml .Values.affinity | indent 10 }} |
| 136 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 137 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 138 | volumes: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 139 | {{ include "common.certInitializer.volumes" . | indent 8 }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 140 | - name: localtime |
| 141 | hostPath: |
| 142 | path: /etc/localtime |
| 143 | - name: papconfig |
| 144 | configMap: |
| 145 | name: {{ include "common.fullname" . }}-configmap |
| 146 | defaultMode: 0755 |
Krzysztof Opasiak | 3d9dc8b | 2020-03-31 23:05:16 +0200 | [diff] [blame] | 147 | - name: papconfig-processed |
| 148 | emptyDir: |
| 149 | medium: Memory |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 150 | imagePullSecrets: |
| 151 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |