3 # ============LICENSE_START=======================================================
5 # ================================================================================
6 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
7 # Copyright (c) 2020 Nokia Intellectual Property. All rights reserved.
8 # Copyright (c) 2020-2021 Orange Intellectual Property. All rights reserved.
9 # Modifications Copyright © 2023 Nordix Foundation
10 # ================================================================================
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
15 # http://www.apache.org/licenses/LICENSE-2.0
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22 # ============LICENSE_END=========================================================
27 name: {{ include "common.fullname" . }}
28 namespace: {{ include "common.namespace" . }}
30 app: {{ include "common.name" . }}
31 app.kubernetes.io/name: {{ include "common.name" . }}
32 {{- if .Chart.AppVersion }}
33 version: "{{ .Chart.AppVersion | replace "+" "_" }}"
35 version: "{{ .Chart.Version | replace "+" "_" }}"
37 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
38 release: {{ include "common.release" . }}
39 heritage: {{ .Release.Service }}
41 replicas: {{ .Values.replicaCount }}
42 minReadySeconds: {{ .Values.minReadySeconds }}
44 type: {{ .Values.updateStrategy.type }}
46 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
47 maxSurge: {{ .Values.updateStrategy.maxSurge }}
50 app: {{ include "common.name" . }}
54 app: {{ include "common.name" . }}
55 release: {{ include "common.release" . }}
56 app.kubernetes.io/name: {{ include "common.name" . }}
57 {{- if .Chart.AppVersion }}
58 version: "{{ .Chart.AppVersion | replace "+" "_" }}"
60 version: "{{ .Chart.Version | replace "+" "_" }}"
62 name: {{ include "common.name" . }}
64 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
66 hostname: aai-graphadmin
67 terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }}
68 {{ if .Values.global.initContainers.enabled }}
71 {{ if .Values.global.jobs.migration.enabled }}
75 - {{ include "common.release" . }}-aai-graphadmin-migration
76 {{ else if .Values.global.jobs.createSchema.enabled }}
80 - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
85 {{- if .Values.global.cassandra.localCluster }}
98 fieldPath: metadata.namespace
99 image: {{ include "repositoryGenerator.image.readiness" . }}
100 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
101 name: {{ include "common.name" . }}-readiness
104 - name: {{ include "common.name" . }}
105 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
106 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
108 - name: LOCAL_USER_ID
109 value: {{ .Values.securityContext.user_id | quote }}
110 - name: LOCAL_GROUP_ID
111 value: {{ .Values.securityContext.group_id | quote }}
112 - name: INTERNAL_PORT_1
113 value: {{ .Values.service.internalPort | quote }}
114 - name: INTERNAL_PORT_2
115 value: {{ .Values.service.internalPort2 | quote }}
116 - name: INTERNAL_PORT_3
117 value: {{ .Values.service.internalPort3 | quote }}
119 - mountPath: /etc/localtime
122 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
124 subPath: janusgraph-realtime.properties
125 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
127 subPath: janusgraph-cached.properties
128 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
130 subPath: aaiconfig.properties
131 - mountPath: /opt/aai/logroot/AAI-RES
133 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
136 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
138 subPath: localhost-access-logback.xml
139 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/realm.properties
141 subPath: realm.properties
142 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
144 subPath: application.properties
146 - containerPort: {{ .Values.service.internalPort }}
147 name: {{ .Values.service.portName }}
148 - containerPort: {{ .Values.service.internalPort2 }}
149 name: {{ .Values.service.portName2 }}
150 - containerPort: {{ .Values.service.internalPort3 }}
151 name: {{ .Values.service.portName3 }}
153 # wait for active requests (long-running tasks) to be finished
154 # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod.
161 while (netstat -an | grep ESTABLISHED | grep -e $INTERNAL_PORT_1 -e $INTERNAL_PORT_2)
164 # disable liveness probe when breakpoints set in debugger
165 # so K8s doesn't restart unresponsive container
166 {{ if .Values.liveness.enabled }}
169 port: {{ .Values.service.internalPort }}
170 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
171 periodSeconds: {{ .Values.liveness.periodSeconds }}
175 port: {{ .Values.service.internalPort }}
176 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
177 periodSeconds: {{ .Values.readiness.periodSeconds }}
178 resources: {{ include "common.resources" . | nindent 10 }}
179 {{- if .Values.nodeSelector }}
181 {{ toYaml .Values.nodeSelector | indent 8 }}
183 {{- if .Values.affinity }}
185 {{ toYaml .Values.affinity | indent 8 }}
188 # side car containers
189 {{ include "common.log.sidecar" . | nindent 6 }}
190 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
197 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
200 name: {{ include "common.fullname" . }}
203 name: {{ include "common.fullname" . }}-properties
204 restartPolicy: {{ .Values.restartPolicy }}
206 - name: {{ include "common.namespace" . }}-docker-registry-key