1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2020 AT&T Intellectual Property.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
23 selector: {{- include "common.selectors" . | nindent 4 }}
24 replicas: {{ .Values.replicaCount }}
26 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
33 - {{ include "common.release" . }}-policy-galera-config
39 fieldPath: metadata.namespace
40 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
41 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42 name: {{ include "common.name" . }}-readiness
47 - "export SQL_PASSWORD_BASE64=`echo -n ${SQL_PASSWORD} | base64`; cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
50 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
53 - name: RESTSERVER_USER
54 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "login") | indent 10 }}
55 - name: RESTSERVER_PASSWORD
56 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "password") | indent 10 }}
58 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "login") | indent 10 }}
60 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "password") | indent 10 }}
61 - name: DISTRIBUTION_USER
62 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "distribution-secret" "key" "login") | indent 10 }}
63 - name: DISTRIBUTION_PASSWORD
64 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "distribution-secret" "key" "password") | indent 10 }}
66 - mountPath: /config-input
69 name: papconfig-processed
70 image: "{{ .Values.global.envsubstImage }}"
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-update-config
73 {{ include "common.certInitializer.initContainer" . | indent 6 }}
75 - name: {{ include "common.name" . }}
76 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 {{- if .Values.global.aafEnabled }}
79 command: ["bash","-c"]
80 args: ["source {{ .Values.certInitializer.credsPath }}/.ci;\
81 cp {{ .Values.certInitializer.credsPath }}/org.onap.policy.p12 ${POLICY_HOME}/etc/ssl/policy-keystore;\
82 /opt/app/policy/pap/bin/policy-pap.sh /opt/app/policy/pap/etc/mounted/config.json"]
84 command: ["/opt/app/policy/pap/bin/policy-pap.sh"]
85 args: ["/opt/app/policy/pap/etc/mounted/config.json"]
87 - name: KEYSTORE_PASSWD
88 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 12 }}
89 - name: TRUSTSTORE_PASSWD
90 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 12 }}
92 ports: {{ include "common.containerPorts" . | nindent 12 }}
93 # disable liveness probe when breakpoints set in debugger
94 # so K8s doesn't restart unresponsive container
95 {{- if eq .Values.liveness.enabled true }}
98 port: {{ .Values.liveness.port }}
99 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
100 periodSeconds: {{ .Values.liveness.periodSeconds }}
104 port: {{ .Values.readiness.port }}
105 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
106 periodSeconds: {{ .Values.readiness.periodSeconds }}
108 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
109 - mountPath: /etc/localtime
112 - mountPath: /opt/app/policy/pap/etc/mounted
113 name: papconfig-processed
115 {{ include "common.resources" . }}
116 {{- if .Values.nodeSelector }}
118 {{ toYaml .Values.nodeSelector | indent 10 }}
120 {{- if .Values.affinity }}
122 {{ toYaml .Values.affinity | indent 10 }}
125 {{ include "common.certInitializer.volumes" . | indent 8 }}
131 name: {{ include "common.fullname" . }}-configmap
133 - name: papconfig-processed
137 - name: "{{ include "common.namespace" . }}-docker-registry-key"