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 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
29 release: {{ include "common.release" . }}
30 heritage: {{ .Release.Service }}
32 replicas: {{ .Values.replicaCount }}
33 minReadySeconds: {{ .Values.minReadySeconds }}
35 type: {{ .Values.updateStrategy.type }}
37 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
38 maxSurge: {{ .Values.updateStrategy.maxSurge }}
41 app: {{ include "common.name" . }}
45 app: {{ include "common.name" . }}
46 release: {{ include "common.release" . }}
47 name: {{ include "common.name" . }}
49 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
50 {{- if .Values.global.msbEnabled }}
51 {{ $values := .Values }}
52 msb.onap.org/service-info: '[
53 {{- range $api_endpoint := $values.aai_enpoints -}}
54 {{- range $api_version := $values.api_list }}
56 "serviceName": "_{{ $api_endpoint.name }}",
57 "version": "v{{ $api_version }}",
58 "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}",
62 "lb_policy":"ip_hash",
64 "path": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}"
67 "serviceName": "{{ $api_endpoint.name }}",
68 "version": "v{{ $api_version }}",
69 "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}",
73 "lb_policy":"ip_hash",
79 "serviceName": "_aai-named-query",
84 "lb_policy":"ip_hash",
89 "serviceName": "aai-named-query",
94 "lb_policy":"ip_hash",
100 hostname: aai-traversal
101 terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }}
106 {{- if .Values.global.jobs.migration.enabled }}
108 - {{ include "common.release" . }}-aai-graphadmin-migration
110 {{- if .Values.global.jobs.createSchema.enabled }}
112 - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
115 {{- if .Values.global.cassandra.localCluster }}
129 fieldPath: metadata.namespace
130 image: {{ include "repositoryGenerator.image.readiness" . }}
131 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
132 name: {{ include "common.name" . }}-readiness
134 - name: {{ include "common.name" . }}
135 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
136 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
142 echo "*** actual launch of AAI Resources"
143 /bin/bash /opt/app/aai-traversal/docker-entrypoint.sh
145 - name: DISABLE_UPDATE_QUERY
146 value: {{ .Values.config.disableUpdateQuery | quote }}
147 - name: LOCAL_USER_ID
148 value: {{ .Values.global.config.userId | quote }}
149 - name: LOCAL_GROUP_ID
150 value: {{ .Values.global.config.groupId | quote }}
151 - name: INTERNAL_PORT_1
152 value: {{ .Values.service.internalPort | quote }}
153 - name: INTERNAL_PORT_2
154 value: {{ .Values.service.internalPort2 | quote }}
155 - name: INTERNAL_PORT_3
156 value: {{ .Values.service.internalPort3 | quote }}
158 - mountPath: /etc/localtime
161 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties
162 name: {{ include "common.fullname" . }}-config
163 subPath: janusgraph-realtime.properties
164 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties
165 name: {{ include "common.fullname" . }}-config
166 subPath: janusgraph-cached.properties
167 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties
168 name: {{ include "common.fullname" . }}-config
169 subPath: aaiconfig.properties
170 - mountPath: /opt/aai/logroot/AAI-GQ
172 - mountPath: /opt/aai/logroot/AAI-GQ/misc
173 name: {{ include "common.fullname" . }}-logs-misc
174 - mountPath: /opt/app/aai-traversal/resources/logback.xml
175 name: {{ include "common.fullname" . }}-config
177 - mountPath: /opt/app/aai-traversal/resources/localhost-access-logback.xml
178 name: {{ include "common.fullname" . }}-config
179 subPath: localhost-access-logback.xml
180 - mountPath: /opt/app/aai-traversal/resources/etc/auth/realm.properties
181 name: {{ include "common.fullname" . }}-config
182 subPath: realm.properties
183 - mountPath: /opt/app/aai-traversal/resources/application.properties
184 name: {{ include "common.fullname" . }}-config
185 subPath: application.properties
186 - mountPath: /opt/app/aai-traversal/resources/application-keycloak.properties
187 name: {{ include "common.fullname" . }}-config
188 subPath: application-keycloak.properties
190 - containerPort: {{ .Values.service.internalPort }}
191 - containerPort: {{ .Values.service.internalPort2 }}
192 - containerPort: {{ .Values.service.internalPort3 }}
194 # wait for active requests (long-running tasks) to be finished
195 # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod.
202 while (netstat -an | grep ESTABLISHED | grep -e $INTERNAL_PORT_1 -e $INTERNAL_PORT_2)
205 # disable liveness probe when breakpoints set in debugger
206 # so K8s doesn't restart unresponsive container
207 {{ if .Values.liveness.enabled }}
210 path: /aai/util/echo?action=checkDB
211 port: {{ .Values.service.internalPort }}
216 - name: X-TransactionId
219 value: application/json
220 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
221 periodSeconds: {{ .Values.liveness.periodSeconds }}
225 path: /aai/util/echo?action=checkDB
226 port: {{ .Values.service.internalPort }}
230 value: ReadinessCheck
231 - name: X-TransactionId
232 value: ReadinessCheck_TID
234 value: application/json
235 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
236 periodSeconds: {{ .Values.readiness.periodSeconds }}
237 resources: {{ include "common.resources" . | nindent 10 }}
238 {{- if .Values.nodeSelector }}
240 {{ toYaml .Values.nodeSelector | indent 8 }}
242 {{- if .Values.affinity }}
244 {{ toYaml .Values.affinity | indent 8 }}
247 # side car containers
248 {{ include "common.log.sidecar" . | nindent 6 }}
249 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
256 - name: {{ include "common.fullname" . }}-logs-misc
258 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
259 - name: {{ include "common.fullname" . }}-config
261 name: {{ include "common.fullname" . }}
262 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
264 - name: "{{ include "common.namespace" . }}-docker-registry-key"