2 # Copyright (c) 2017 Amdocs, Bell Canada
3 # Modifications Copyright (c) 2018 AT&T
4 # Modifications Copyright (c) 2020 Nokia
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.
22 name: {{ include "common.fullname" . }}
23 namespace: {{ include "common.namespace" . }}
25 app: {{ include "common.name" . }}
26 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
27 release: {{ include "common.release" . }}
28 heritage: {{ .Release.Service }}
30 replicas: {{ .Values.replicaCount }}
32 type: {{ .Values.updateStrategy.type }}
33 {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
35 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
36 maxSurge: {{ .Values.updateStrategy.maxSurge }}
40 app: {{ include "common.name" . }}
44 sidecar.istio.io/rewriteAppHTTPProbers: "false"
46 app: {{ include "common.name" . }}
47 release: {{ include "common.release" . }}
48 name: {{ include "common.name" . }}
50 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
51 {{- if ( include "common.needTLS" .) }}
57 echo "*** retrieve Truststore and Keystore password"
58 export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop \
60 if [ -z "$KEYSTORE_PASSWORD" ]
62 echo " /!\ certificates retrieval failed"
65 echo "*** write them in portal part"
67 for PFILE in `ls -1 .`
69 envsubst <${PFILE} >/config/${PFILE}
71 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
72 - mountPath: /config-input
73 name: portal-config-input
76 image: {{ include "repositoryGenerator.image.envsubst" . }}
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 name: {{ include "common.name" . }}-update-config
90 fieldPath: metadata.namespace
91 image: {{ include "repositoryGenerator.image.readiness" . }}
92 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 name: {{ include "common.name" . }}-readiness
95 - name: {{ include "common.name" . }}
96 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
97 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
103 echo "*** retrieve Truststore and Keystore password"
104 export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop \
106 echo "*** actual launch of AAI Sparky BE"
107 /opt/app/sparky/bin/start.sh
108 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
109 - mountPath: /etc/localtime
112 - mountPath: /opt/app/sparky/config/auth/csp-cookie-filter.properties
114 subPath: csp-cookie-filter.properties
115 - mountPath: /opt/app/sparky/config/portal/
117 - mountPath: /opt/app/sparky/config/portal/BOOT-INF/classes/
118 name: portal-config-props
119 - mountPath: {{ .Values.log.path }}
121 - mountPath: /opt/app/sparky/config/application.properties
123 subPath: application.properties
124 - mountPath: /opt/app/sparky/config/application-resources.properties
126 subPath: application-resources.properties
127 - mountPath: /opt/app/sparky/config/application-ssl.properties
129 subPath: application-ssl.properties
130 - mountPath: /opt/app/sparky/config/application-oxm-default.properties
132 subPath: application-oxm-default.properties
133 - mountPath: /opt/app/sparky/config/application-oxm-override.properties
135 subPath: application-oxm-override.properties
136 - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties
138 subPath: application-oxm-schema-prod.properties
139 - mountPath: /opt/app/sparky/config/roles.config
141 subPath: roles.config
142 - mountPath: /opt/app/sparky/config/users.config
144 subPath: users.config
145 - mountPath: /opt/app/sparky/config/logging/logback.xml
149 - containerPort: {{ .Values.service.internalPort }}
150 - containerPort: {{ .Values.service.internalPlainPort }}
151 # disable liveness probe when breakpoints set in debugger
152 # so K8s doesn't restart unresponsive container
153 {{- if eq .Values.liveness.enabled true }}
156 port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }}
157 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
158 periodSeconds: {{ .Values.liveness.periodSeconds }}
162 port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }}
163 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
164 periodSeconds: {{ .Values.readiness.periodSeconds }}
165 resources: {{ include "common.resources" . | nindent 10 }}
166 {{- if .Values.nodeSelector }}
168 {{ toYaml .Values.nodeSelector | indent 8 }}
170 {{- if .Values.affinity }}
172 {{ toYaml .Values.affinity | indent 8 }}
175 # side car containers
176 {{ include "common.log.sidecar" . | nindent 6 }}
177 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
178 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
184 name: {{ include "common.fullname" . }}
185 - name: portal-config
186 {{- if .Values.global.aafEnabled }}
189 - name: portal-config-input
192 name: {{ include "common.fullname" . }}-portal
193 - name: portal-config-props
195 name: {{ include "common.fullname" . }}-portal-props
198 secretName: {{ include "common.fullname" . }}
201 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
204 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
206 - name: "{{ include "common.namespace" . }}-docker-registry-key"