2 # ============LICENSE_START=======================================================
3 # Copyright (C) 2020 AT&T Intellectual Property.
4 # Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
24 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
26 selector: {{- include "common.selectors" . | nindent 4 }}
27 replicas: {{ .Values.replicaCount }}
29 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
36 - {{ include "common.release" . }}-policy-galera-config
42 fieldPath: metadata.namespace
43 image: {{ include "repositoryGenerator.image.readiness" . }}
44 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45 name: {{ include "common.name" . }}-readiness
50 - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done"
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
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 }}
61 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "login") | indent 10 }}
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 }}
68 {{- if .Values.config.useStrimziKafka }}
70 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-kafka-user" "key" "sasl.jaas.config") | indent 10 }}
73 - mountPath: /config-input
76 name: papconfig-processed
77 image: {{ include "repositoryGenerator.image.envsubst" . }}
78 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
79 name: {{ include "common.name" . }}-update-config
81 - name: {{ include "common.name" . }}
82 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
83 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
84 command: ["/opt/app/policy/pap/bin/policy-pap.sh"]
85 args: ["/opt/app/policy/pap/etc/mounted/papParameters.yaml"]
86 ports: {{ include "common.containerPorts" . | nindent 12 }}
87 # disable liveness probe when breakpoints set in debugger
88 # so K8s doesn't restart unresponsive container
89 {{- if eq .Values.liveness.enabled true }}
92 port: {{ .Values.liveness.port }}
93 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.liveness.periodSeconds }}
98 path: {{ .Values.readiness.api }}
99 port: {{ .Values.readiness.port }}
101 - name: Authorization
102 value: Basic {{ printf "%s:%s" .Values.restServer.user .Values.restServer.password | b64enc }}
104 successThreshold: {{ .Values.readiness.successThreshold }}
105 failureThreshold: {{ .Values.readiness.failureThreshold }}
106 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
107 periodSeconds: {{ .Values.readiness.periodSeconds }}
108 timeoutSeconds: {{ .Values.readiness.timeout }}
110 - mountPath: /etc/localtime
113 - mountPath: /opt/app/policy/pap/etc/mounted
114 name: papconfig-processed
115 resources: {{ include "common.resources" . | nindent 12 }}
116 {{- if .Values.nodeSelector }}
118 {{ toYaml .Values.nodeSelector | indent 10 }}
120 {{- if .Values.affinity }}
122 {{ toYaml .Values.affinity | indent 10 }}
124 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
131 name: {{ include "common.fullname" . }}-configmap
133 - name: papconfig-processed
137 - name: "{{ include "common.namespace" . }}-docker-registry-key"