1 # Modifications Copyright © 2018 Amdocs,Bell Canada
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
19 selector: {{- include "common.selectors" . | nindent 4 }}
20 replicas: {{ .Values.replicaCount }}
22 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
24 {{- if or .Values.global.aafEnabled .Values.PG.enabled }}
30 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
33 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
35 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
37 - mountPath: /config-input
38 name: {{ include "common.name" . }}-config-input
40 name: {{ include "common.name" . }}-config
41 image: "{{ .Values.global.envsubstImage }}"
42 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 name: {{ include "common.name" . }}-update-config
44 {{ include "common.certInitializer.initContainer" . | nindent 6 }}
45 - name: {{ include "common.name" . }}-permission-fixer
46 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
47 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
49 command: ["chown","-Rf","1000:1001", "/opt/app/"]
50 # See AAF-425 for explanation of why this is needed.
51 # This artifact is provisioned in AAF for both pks12 and jks format and apparently
52 # the cadi library is not using the jks password on the jks keystore.
53 # So, this attempts to "fix" the credential property file until this is fixed properly.
54 - name: {{ include "common.name" . }}-cred-fixer
55 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
59 args: [ "-c", "sed -i -e '/cadi_keystore_password=/d' -e '/cadi_keystore_password_jks/p' -e 's/cadi_keystore_password_jks/cadi_keystore_password/' -e 's/dmaap-bc.p12/dmaap-bc.jks/' /opt/app/osaaf/local/org.onap.dmaap-bc.cred.props" ]
60 - name: {{ include "common.name" . }}-postgres-readiness
65 - {{ .Values.postgres.nameOverride }}
75 fieldPath: metadata.namespace
76 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 - name: {{ include "common.name" . }}
81 image: "{{ .Values.repository }}/{{ .Values.image }}"
82 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
83 ports: {{ include "common.containerPorts" . | nindent 10 }}
84 {{ if eq .Values.liveness.enabled true -}}
87 port: {{ .Values.liveness.port }}
89 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
90 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
91 periodSeconds: {{ .Values.liveness.periodSeconds }}
95 port: {{ .Values.readiness.port }}
97 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
98 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
99 periodSeconds: {{ .Values.readiness.periodSeconds }}
100 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
101 - mountPath: /etc/localtime
104 # NOTE: on the following several configMaps, careful to include / at end
105 # since there may be more than one file in each mountPath
106 - name: {{ include "common.name" . }}-config
107 mountPath: /opt/app/config/conf/
108 resources: {{ include "common.resources" . | nindent 12 }}
109 {{- if .Values.nodeSelector }}
110 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
112 {{- if .Values.affinity }}
113 affinity: {{ toYaml .Values.affinity | nindent 10 }}
115 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
119 - name: {{ include "common.name" . }}-config-input
121 name: {{ include "common.fullname" . }}-config
122 - name: {{ include "common.name" . }}-config
126 - name: "{{ include "common.namespace" . }}-docker-registry-key"