blob: 6f02f8e4c0291a6653e187db1c7f8bdaa1aba9e4 [file] [log] [blame]
Jakub Latusekd71d26c2020-10-21 13:36:29 +02001{{/*
jhhd4258672020-08-09 12:08:08 -05002# ============LICENSE_START=======================================================
3# Copyright (C) 2020 AT&T Intellectual Property.
a.sreekumar2f377362022-02-09 12:40:57 +00004# Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
jhhd4258672020-08-09 12:08:08 -05005# ================================================================================
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 Latusekd71d26c2020-10-21 13:36:29 +020020*/}}
jhhd4258672020-08-09 12:08:08 -050021
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020022apiVersion: apps/v1
ramverma1a3b8ad2019-02-25 12:45:11 +000023kind: Deployment
Bruno Sakoto0644c262020-05-22 16:56:35 -040024metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
ramverma1a3b8ad2019-02-25 12:45:11 +000025spec:
Bruno Sakoto0644c262020-05-22 16:56:35 -040026 selector: {{- include "common.selectors" . | nindent 4 }}
ramverma1a3b8ad2019-02-25 12:45:11 +000027 replicas: {{ .Values.replicaCount }}
28 template:
Bruno Sakoto0644c262020-05-22 16:56:35 -040029 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
ramverma1a3b8ad2019-02-25 12:45:11 +000030 spec:
ramverma6acdabf2019-04-12 18:56:03 +000031 initContainers:
32 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020033 - /app/ready.py
ramverma6acdabf2019-04-12 18:56:03 +000034 args:
jhhd4258672020-08-09 12:08:08 -050035 - --job-name
36 - {{ include "common.release" . }}-policy-galera-config
ramverma6acdabf2019-04-12 18:56:03 +000037 env:
38 - name: NAMESPACE
39 valueFrom:
40 fieldRef:
41 apiVersion: v1
42 fieldPath: metadata.namespace
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010043 image: {{ include "repositoryGenerator.image.readiness" . }}
ramverma6acdabf2019-04-12 18:56:03 +000044 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45 name: {{ include "common.name" . }}-readiness
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +020046 - command:
47 - sh
48 args:
49 - -c
Taka Choebd62952020-10-08 13:50:09 -040050 - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done"
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +020051 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 Mizyn389fca12020-04-09 22:37:00 +020056 - 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_Manchikanti73c5f002022-07-25 17:04:45 +010068{{- 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 Opasiak3d9dc8b2020-03-31 23:05:16 +020072 volumeMounts:
73 - mountPath: /config-input
74 name: papconfig
75 - mountPath: /config
76 name: papconfig-processed
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010077 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +020078 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
79 name: {{ include "common.name" . }}-update-config
jhhd4258672020-08-09 12:08:08 -050080{{ include "common.certInitializer.initContainer" . | indent 6 }}
ramverma1a3b8ad2019-02-25 12:45:11 +000081 containers:
82 - name: {{ include "common.name" . }}
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010083 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
ramverma1a3b8ad2019-02-25 12:45:11 +000084 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
jhhd4258672020-08-09 12:08:08 -050085{{- if .Values.global.aafEnabled }}
Taka Cho9658ce82020-12-10 14:34:18 -050086 command: ["sh","-c"]
jhhd4258672020-08-09 12:08:08 -050087 args: ["source {{ .Values.certInitializer.credsPath }}/.ci;\
a.sreekumar2f377362022-02-09 12:40:57 +000088 /opt/app/policy/pap/bin/policy-pap.sh /opt/app/policy/pap/etc/mounted/papParameters.yaml"]
jhhd4258672020-08-09 12:08:08 -050089{{- else }}
ramverma1a3b8ad2019-02-25 12:45:11 +000090 command: ["/opt/app/policy/pap/bin/policy-pap.sh"]
a.sreekumar2f377362022-02-09 12:40:57 +000091 args: ["/opt/app/policy/pap/etc/mounted/papParameters.yaml"]
jhhd4258672020-08-09 12:08:08 -050092 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 Sakoto0644c262020-05-22 16:56:35 -040098 ports: {{ include "common.containerPorts" . | nindent 12 }}
ramverma1a3b8ad2019-02-25 12:45:11 +000099 # 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 Sakoto0644c262020-05-22 16:56:35 -0400104 port: {{ .Values.liveness.port }}
ramverma1a3b8ad2019-02-25 12:45:11 +0000105 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
106 periodSeconds: {{ .Values.liveness.periodSeconds }}
107 {{ end -}}
108 readinessProbe:
a.sreekumar2f377362022-02-09 12:40:57 +0000109 httpGet:
110 path: {{ .Values.readiness.api }}
Bruno Sakoto0644c262020-05-22 16:56:35 -0400111 port: {{ .Values.readiness.port }}
a.sreekumar2f377362022-02-09 12:40:57 +0000112 httpHeaders:
113 - name: Authorization
114 value: Basic {{ printf "%s:%s" .Values.restServer.user .Values.restServer.password | b64enc }}
115 scheme: {{ .Values.readiness.scheme }}
116 successThreshold: {{ .Values.readiness.successThreshold }}
117 failureThreshold: {{ .Values.readiness.failureThreshold }}
ramverma1a3b8ad2019-02-25 12:45:11 +0000118 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
119 periodSeconds: {{ .Values.readiness.periodSeconds }}
a.sreekumar2f377362022-02-09 12:40:57 +0000120 timeoutSeconds: {{ .Values.readiness.timeout }}
ramverma1a3b8ad2019-02-25 12:45:11 +0000121 volumeMounts:
jhhd4258672020-08-09 12:08:08 -0500122{{ include "common.certInitializer.volumeMount" . | indent 10 }}
ramverma1a3b8ad2019-02-25 12:45:11 +0000123 - mountPath: /etc/localtime
124 name: localtime
125 readOnly: true
126 - mountPath: /opt/app/policy/pap/etc/mounted
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +0200127 name: papconfig-processed
ramverma1a3b8ad2019-02-25 12:45:11 +0000128 resources:
jhhd4258672020-08-09 12:08:08 -0500129{{ include "common.resources" . }}
ramverma1a3b8ad2019-02-25 12:45:11 +0000130 {{- if .Values.nodeSelector }}
131 nodeSelector:
132{{ toYaml .Values.nodeSelector | indent 10 }}
133 {{- end -}}
134 {{- if .Values.affinity }}
135 affinity:
136{{ toYaml .Values.affinity | indent 10 }}
137 {{- end }}
farida azmyc1178372021-04-11 12:55:33 +0200138 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
ramverma1a3b8ad2019-02-25 12:45:11 +0000139 volumes:
jhhd4258672020-08-09 12:08:08 -0500140{{ include "common.certInitializer.volumes" . | indent 8 }}
ramverma1a3b8ad2019-02-25 12:45:11 +0000141 - name: localtime
142 hostPath:
143 path: /etc/localtime
144 - name: papconfig
145 configMap:
146 name: {{ include "common.fullname" . }}-configmap
147 defaultMode: 0755
Krzysztof Opasiak3d9dc8b2020-03-31 23:05:16 +0200148 - name: papconfig-processed
149 emptyDir:
150 medium: Memory
ramverma1a3b8ad2019-02-25 12:45:11 +0000151 imagePullSecrets:
152 - name: "{{ include "common.namespace" . }}-docker-registry-key"