2 # Copyright (c) 2017 Amdocs, Bell Canada
3 # Modifications Copyright (c) 2018 AT&T
4 # Modifications Copyright (c) 2020 Nokia, Orange
5 # Modifications Copyright (c) 2021 Orange
6 # Modifications Copyright © 2023 Nordix Foundation
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
24 name: {{ include "common.fullname" . }}
25 namespace: {{ include "common.namespace" . }}
27 app: {{ include "common.name" . }}
28 app.kubernetes.io/name: {{ include "common.name" . }}
29 {{- if .Chart.AppVersion }}
30 version: "{{ .Chart.AppVersion | replace "+" "_" }}"
32 version: "{{ .Chart.Version | replace "+" "_" }}"
34 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
35 release: {{ include "common.release" . }}
36 heritage: {{ .Release.Service }}
38 replicas: {{ .Values.replicaCount }}
39 minReadySeconds: {{ .Values.minReadySeconds }}
41 type: {{ .Values.updateStrategy.type }}
43 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
44 maxSurge: {{ .Values.updateStrategy.maxSurge }}
47 app: {{ include "common.name" . }}
51 app: {{ include "common.name" . }}
52 release: {{ include "common.release" . }}
53 app.kubernetes.io/name: {{ include "common.name" . }}
54 {{- if .Chart.AppVersion }}
55 version: "{{ .Chart.AppVersion | replace "+" "_" }}"
57 version: "{{ .Chart.Version | replace "+" "_" }}"
59 name: {{ include "common.name" . }}
61 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
62 {{- if .Values.global.msbEnabled }}
63 {{ $values := .Values }}
64 msb.onap.org/service-info: '[
65 {{- range $api_endpoint := $values.aai_enpoints -}}
66 {{- range $api_version := $values.api_list }}
68 "serviceName": "_{{ $api_endpoint.name }}",
69 "version": "v{{ $api_version }}",
70 "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}",
74 "lb_policy":"ip_hash",
76 "path": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}"
79 "serviceName": "{{ $api_endpoint.name }}",
80 "version": "v{{ $api_version }}",
81 "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}",
85 "lb_policy":"ip_hash",
91 "serviceName": "_aai-named-query",
96 "lb_policy":"ip_hash",
101 "serviceName": "aai-named-query",
102 "url": "/aai/search",
106 "lb_policy":"ip_hash",
112 hostname: aai-traversal
113 terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }}
118 {{- if .Values.global.jobs.migration.enabled }}
120 - {{ include "common.release" . }}-aai-graphadmin-migration
122 {{- if .Values.global.jobs.createSchema.enabled }}
124 - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
127 {{- if .Values.global.cassandra.localCluster }}
141 fieldPath: metadata.namespace
142 image: {{ include "repositoryGenerator.image.readiness" . }}
143 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
144 name: {{ include "common.name" . }}-readiness
146 - name: {{ include "common.name" . }}
147 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
148 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
154 echo "*** actual launch of AAI Resources"
155 /bin/bash /opt/app/aai-traversal/docker-entrypoint.sh
157 {{- if .Values.config.env }}
158 {{- range $key,$value := .Values.config.env }}
159 - name: {{ $key | upper | quote}}
160 value: {{ $value | quote}}
163 - name: DISABLE_UPDATE_QUERY
164 value: {{ .Values.config.disableUpdateQuery | quote }}
165 - name: LOCAL_USER_ID
166 value: {{ .Values.global.config.userId | quote }}
167 - name: LOCAL_GROUP_ID
168 value: {{ .Values.global.config.groupId | quote }}
169 - name: INTERNAL_PORT_1
170 value: {{ .Values.service.internalPort | quote }}
171 - name: INTERNAL_PORT_2
172 value: {{ .Values.service.internalPort2 | quote }}
173 - name: INTERNAL_PORT_3
174 value: {{ .Values.service.internalPort3 | quote }}
176 - mountPath: /etc/localtime
179 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties
180 name: {{ include "common.fullname" . }}-config
181 subPath: janusgraph-realtime.properties
182 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties
183 name: {{ include "common.fullname" . }}-config
184 subPath: janusgraph-cached.properties
185 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties
186 name: {{ include "common.fullname" . }}-config
187 subPath: aaiconfig.properties
188 - mountPath: /opt/aai/logroot/AAI-GQ
190 - mountPath: /opt/aai/logroot/AAI-GQ/misc
191 name: {{ include "common.fullname" . }}-logs-misc
192 - mountPath: /opt/app/aai-traversal/resources/logback.xml
193 name: {{ include "common.fullname" . }}-config
195 - mountPath: /opt/app/aai-traversal/resources/localhost-access-logback.xml
196 name: {{ include "common.fullname" . }}-config
197 subPath: localhost-access-logback.xml
198 - mountPath: /opt/app/aai-traversal/resources/etc/auth/realm.properties
199 name: {{ include "common.fullname" . }}-config
200 subPath: realm.properties
201 - mountPath: /opt/app/aai-traversal/resources/application.properties
202 name: {{ include "common.fullname" . }}-config
203 subPath: application.properties
204 - mountPath: /opt/app/aai-traversal/resources/application-keycloak.properties
205 name: {{ include "common.fullname" . }}-config
206 subPath: application-keycloak.properties
208 - containerPort: {{ .Values.service.internalPort }}
209 name: {{ .Values.service.portName }}
210 - containerPort: {{ .Values.service.internalPort2 }}
211 name: {{ .Values.service.portName2 }}
212 - containerPort: {{ .Values.service.internalPort3 }}
213 name: {{ .Values.service.portName3 }}
215 # wait for active requests (long-running tasks) to be finished
216 # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod.
223 while (netstat -an | grep ESTABLISHED | grep -e $INTERNAL_PORT_1 -e $INTERNAL_PORT_2)
226 # disable liveness probe when breakpoints set in debugger
227 # so K8s doesn't restart unresponsive container
228 {{ if .Values.liveness.enabled }}
231 path: /aai/util/echo?action=checkDB
232 port: {{ .Values.service.internalPort }}
237 - name: X-TransactionId
240 value: application/json
241 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
242 periodSeconds: {{ .Values.liveness.periodSeconds }}
246 path: /aai/util/echo?action=checkDB
247 port: {{ .Values.service.internalPort }}
251 value: ReadinessCheck
252 - name: X-TransactionId
253 value: ReadinessCheck_TID
255 value: application/json
256 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
257 periodSeconds: {{ .Values.readiness.periodSeconds }}
258 resources: {{ include "common.resources" . | nindent 10 }}
259 {{- if .Values.nodeSelector }}
261 {{ toYaml .Values.nodeSelector | indent 8 }}
263 {{- if .Values.affinity }}
265 {{ toYaml .Values.affinity | indent 8 }}
268 # side car containers
269 {{ include "common.log.sidecar" . | nindent 6 }}
270 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
277 - name: {{ include "common.fullname" . }}-logs-misc
279 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
280 - name: {{ include "common.fullname" . }}-config
282 name: {{ include "common.fullname" . }}
283 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
285 - name: "{{ include "common.namespace" . }}-docker-registry-key"