2 # Copyright (c) 2017 Amdocs, Bell Canada
3 # Modifications Copyright (c) 2018 AT&T
4 # Modifications Copyright (c) 2020 Nokia
5 # Modifications Copyright (c) 2021 Orange
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
23 name: {{ include "common.fullname" . }}
24 namespace: {{ include "common.namespace" . }}
26 app: {{ include "common.name" . }}
27 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
28 release: {{ include "common.release" . }}
29 heritage: {{ .Release.Service }}
31 replicas: {{ .Values.replicaCount }}
32 minReadySeconds: {{ .Values.minReadySeconds }}
34 type: {{ .Values.updateStrategy.type }}
36 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
37 maxSurge: {{ .Values.updateStrategy.maxSurge }}
40 app: {{ include "common.name" . }}
44 app: {{ include "common.name" . }}
45 release: {{ include "common.release" . }}
46 name: {{ include "common.name" . }}
48 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
49 {{- if .Values.global.msbEnabled }}
50 {{ $values := .Values }}
51 msb.onap.org/service-info: '[
52 {{- range $api_endpoint := $values.aai_enpoints -}}
53 {{- range $api_version := $values.api_list }}
55 "serviceName": "_{{ $api_endpoint.name }}",
56 "version": "v{{ $api_version }}",
57 "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}",
61 "lb_policy":"ip_hash",
63 "path": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}"
66 "serviceName": "{{ $api_endpoint.name }}",
67 "version": "v{{ $api_version }}",
68 "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}",
72 "lb_policy":"ip_hash",
80 hostname: aai-resources
81 terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }}
82 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
83 - name: {{ include "common.name" . }}-readiness
87 {{- if .Values.global.jobs.migration.enabled }}
89 - {{ include "common.release" . }}-aai-graphadmin-migration
91 {{- if .Values.global.jobs.createSchema.enabled }}
93 - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
96 {{- if .Values.global.cassandra.localCluster }}
110 fieldPath: metadata.namespace
111 image: {{ include "repositoryGenerator.image.readiness" . }}
112 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
114 - name: {{ include "common.name" . }}
115 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
116 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
122 echo "*** retrieve Truststore and Keystore password"
123 export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
124 echo "*** actual launch of AAI Resources"
125 /bin/bash /opt/app/aai-resources/docker-entrypoint.sh
127 - name: LOCAL_USER_ID
128 value: {{ .Values.global.config.userId | quote }}
129 - name: LOCAL_GROUP_ID
130 value: {{ .Values.global.config.groupId | quote }}
131 - name: POST_JAVA_OPTS
132 value: '-Djavax.net.ssl.trustStore={{ .Values.certInitializer.credsPath }}/truststoreONAPall.jks -Djavax.net.ssl.trustStorePassword={{ .Values.certInitializer.truststorePassword }}'
133 - name: TRUSTORE_ALL_PASSWORD
134 value: {{ .Values.certInitializer.truststorePassword }}
135 - name: INTERNAL_PORT_1
136 value: {{ .Values.service.internalPort | quote }}
137 - name: INTERNAL_PORT_2
138 value: {{ .Values.service.internalPort2 | quote }}
139 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
140 - mountPath: /etc/localtime
143 - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-realtime.properties
144 name: {{ include "common.fullname" . }}-config
145 subPath: janusgraph-realtime.properties
146 - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-cached.properties
147 name: {{ include "common.fullname" . }}-config
148 subPath: janusgraph-cached.properties
149 - mountPath: /opt/app/aai-resources/resources/etc/appprops/aaiconfig.properties
150 name: {{ include "common.fullname" . }}-config
151 subPath: aaiconfig.properties
152 - mountPath: /opt/aai/logroot/AAI-RES
154 - mountPath: /opt/app/aai-resources/resources/logback.xml
155 name: {{ include "common.fullname" . }}-config
157 - mountPath: /opt/app/aai-resources/resources/localhost-access-logback.xml
158 name: {{ include "common.fullname" . }}-config
159 subPath: localhost-access-logback.xml
160 - mountPath: /opt/app/aai-resources/resources/etc/auth/realm.properties
161 name: {{ include "common.fullname" . }}-config
162 subPath: realm.properties
163 - mountPath: /opt/app/aai-resources/resources/aaf/bath_config.csv
164 name: {{ include "common.fullname" . }}-aaf-certs
165 subPath: bath_config.csv
166 - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.props
167 name: {{ include "common.fullname" . }}-aaf-properties
168 subPath: org.onap.aai.props
169 - mountPath: /opt/app/aai-resources/resources/aaf/org.osaaf.location.props
170 name: {{ include "common.fullname" . }}-aaf-properties
171 subPath: org.osaaf.location.props
172 - mountPath: /opt/app/aai-resources/resources/aaf/permissions.properties
173 name: {{ include "common.fullname" . }}-aaf-properties
174 subPath: permissions.properties
175 - mountPath: /opt/app/aai-resources/resources/cadi.properties
176 name: {{ include "common.fullname" . }}-aaf-properties
177 subPath: cadi.properties
178 - mountPath: /opt/app/aai-resources/resources/application.properties
179 name: {{ include "common.fullname" . }}-config
180 subPath: application.properties
181 - mountPath: /opt/app/aai-resources/resources/application-keycloak.properties
182 name: {{ include "common.fullname" . }}-config
183 subPath: application-keycloak.properties
185 - containerPort: {{ .Values.service.internalPort }}
186 - containerPort: {{ .Values.service.internalPort2 }}
188 # wait for active requests (long-running tasks) to be finished
189 # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod.
196 while (netstat -an | grep ESTABLISHED | grep -e $INTERNAL_PORT_1 -e $INTERNAL_PORT_2)
199 # disable liveness probe when breakpoints set in debugger
200 # so K8s doesn't restart unresponsive container
201 {{- if .Values.liveness.enabled }}
204 path: /aai/util/echo?action=checkDB
205 port: {{ .Values.service.internalPort }}
206 scheme: HTTP{{ (eq "true" (include "common.needTLS" .)) | ternary "S" "" }}
210 - name: X-TransactionId
213 value: application/json
214 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
215 periodSeconds: {{ .Values.liveness.periodSeconds }}
219 path: /aai/util/echo?action=checkDB
220 port: {{ .Values.service.internalPort }}
221 scheme: HTTP{{ (eq "true" (include "common.needTLS" .)) | ternary "S" "" }}
224 value: ReadinessCheck
225 - name: X-TransactionId
226 value: ReadinessCheck_TID
228 value: application/json
229 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
230 periodSeconds: {{ .Values.readiness.periodSeconds }}
231 resources: {{ include "common.resources" . | nindent 12 }}
232 {{- if .Values.nodeSelector }}
233 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
235 {{- if .Values.affinity }}
236 affinity: {{ toYaml .Values.affinity | nindent 8 }}
238 # side car containers
239 {{ include "common.log.sidecar" . | nindent 6 }}
240 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
241 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
247 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
248 - name: {{ include "common.fullname" . }}-config
250 name: {{ include "common.fullname" . }}
251 - name: {{ include "common.fullname" . }}-aaf-properties
253 name: {{ include "common.fullname" . }}-aaf-props
254 - name: {{ include "common.fullname" . }}-aaf-certs
256 secretName: {{ include "common.fullname" . }}-aaf-keys
257 restartPolicy: {{ .Values.restartPolicy }}
259 - name: "{{ include "common.namespace" . }}-docker-registry-key"