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
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",
81 hostname: aai-resources
82 terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }}
84 - name: {{ include "common.name" . }}-readiness
88 {{- if .Values.global.jobs.migration.enabled }}
90 - {{ include "common.release" . }}-aai-graphadmin-migration
92 {{- if .Values.global.jobs.createSchema.enabled }}
94 - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
97 {{- if .Values.global.cassandra.localCluster }}
111 fieldPath: metadata.namespace
112 image: {{ include "repositoryGenerator.image.readiness" . }}
113 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
115 - name: {{ include "common.name" . }}
116 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
117 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
123 echo "*** actual launch of AAI Resources"
124 /bin/bash /opt/app/aai-resources/docker-entrypoint.sh
126 - name: LOCAL_USER_ID
127 value: {{ .Values.global.config.userId | quote }}
128 - name: LOCAL_GROUP_ID
129 value: {{ .Values.global.config.groupId | quote }}
130 - name: INTERNAL_PORT_1
131 value: {{ .Values.service.internalPort | quote }}
132 - name: INTERNAL_PORT_2
133 value: {{ .Values.service.internalPort2 | quote }}
134 - name: INTERNAL_PORT_3
135 value: {{ .Values.service.internalPort3 | quote }}
137 - mountPath: /etc/localtime
140 - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-realtime.properties
141 name: {{ include "common.fullname" . }}-config
142 subPath: janusgraph-realtime.properties
143 - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-cached.properties
144 name: {{ include "common.fullname" . }}-config
145 subPath: janusgraph-cached.properties
146 - mountPath: /opt/app/aai-resources/resources/etc/appprops/aaiconfig.properties
147 name: {{ include "common.fullname" . }}-config
148 subPath: aaiconfig.properties
149 - mountPath: /opt/aai/logroot/AAI-RES
151 - mountPath: /opt/app/aai-resources/resources/logback.xml
152 name: {{ include "common.fullname" . }}-config
154 - mountPath: /opt/app/aai-resources/resources/localhost-access-logback.xml
155 name: {{ include "common.fullname" . }}-config
156 subPath: localhost-access-logback.xml
157 - mountPath: /opt/app/aai-resources/resources/etc/auth/realm.properties
158 name: {{ include "common.fullname" . }}-config
159 subPath: realm.properties
160 - mountPath: /opt/app/aai-resources/resources/application.properties
161 name: {{ include "common.fullname" . }}-config
162 subPath: application.properties
163 - mountPath: /opt/app/aai-resources/resources/application-keycloak.properties
164 name: {{ include "common.fullname" . }}-config
165 subPath: application-keycloak.properties
167 - containerPort: {{ .Values.service.internalPort }}
168 - containerPort: {{ .Values.service.internalPort2 }}
169 - containerPort: {{ .Values.service.internalPort3 }}
171 # wait for active requests (long-running tasks) to be finished
172 # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod.
179 while (netstat -an | grep ESTABLISHED | grep -e $INTERNAL_PORT_1 -e $INTERNAL_PORT_2)
182 # disable liveness probe when breakpoints set in debugger
183 # so K8s doesn't restart unresponsive container
184 {{- if .Values.liveness.enabled }}
187 path: /aai/util/echo?action=checkDB
188 port: {{ .Values.service.internalPort }}
193 - name: X-TransactionId
196 value: application/json
197 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
198 periodSeconds: {{ .Values.liveness.periodSeconds }}
202 path: /aai/util/echo?action=checkDB
203 port: {{ .Values.service.internalPort }}
207 value: ReadinessCheck
208 - name: X-TransactionId
209 value: ReadinessCheck_TID
211 value: application/json
212 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
213 periodSeconds: {{ .Values.readiness.periodSeconds }}
214 resources: {{ include "common.resources" . | nindent 10 }}
215 {{- if .Values.nodeSelector }}
216 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
218 {{- if .Values.affinity }}
219 affinity: {{ toYaml .Values.affinity | nindent 8 }}
221 # side car containers
222 {{ include "common.log.sidecar" . | nindent 6 }}
223 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
230 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
231 - name: {{ include "common.fullname" . }}-config
233 name: {{ include "common.fullname" . }}
234 restartPolicy: {{ .Values.restartPolicy }}
236 - name: "{{ include "common.namespace" . }}-docker-registry-key"