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=========================================================
24 # In ONAP, the following job will always be run on each installation
25 # The following job will go through the latest oxm and
26 # create properties based on the data type defined in the oxm
27 # and create the required indexes for the appropriate properties
28 # This can be run multiple times as the code if the index or property already exists
29 # then the index or property won't be created again
30 # NOTE - During the execution of the createSchema job, there should
31 # be no other janusgraph connection to the graph as its the reason
32 # that resources traversal and graphadmin wait until this job is done
33 # If you are using an existing cassandra cluster not coming from oom
34 # then it is your job to ensure that there are no connections to the database
37 {{- if .Values.global.jobs.migration.enabled }}
42 name: {{ include "common.fullname" . }}-migration
43 namespace: {{ include "common.namespace" . }}
45 app: {{ include "common.name" . }}-job
46 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
47 release: {{ include "common.release" . }}
48 heritage: {{ .Release.Service }}
50 "helm.sh/hook": post-upgrade,post-rollback,post-install
51 "helm.sh/hook-weight": "1"
52 "helm.sh/hook-delete-policy": before-hook-creation
58 app: {{ include "common.name" . }}-job
59 release: {{ include "common.release" . }}
60 name: {{ include "common.name" . }}
67 {{- if .Values.global.cassandra.localCluster }}
79 fieldPath: metadata.namespace
80 image: {{ include "repositoryGenerator.image.readiness" . }}
81 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
82 name: {{ include "common.name" . }}-readiness
95 bash docker-entrypoint.sh dataRestoreFromSnapshot.sh `ls -t /opt/app/aai-graphadmin/logs/data/dataSnapshots|head -1|awk -F".P" '{ print $1 }'`
98 value: {{ .Values.securityContext.user_id | quote }}
99 - name: LOCAL_GROUP_ID
100 value: {{ .Values.securityContext.group_id | quote }}
102 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
104 subPath: janusgraph-realtime.properties
105 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
107 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
109 subPath: janusgraph-cached.properties
110 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
112 subPath: aaiconfig.properties
113 - mountPath: /opt/aai/logroot/AAI-GA
115 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
118 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
120 subPath: localhost-access-logback.xml
121 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
123 subPath: application.properties
124 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
125 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
126 name: {{ include "common.name" . }}-restore-backup
128 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
129 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
130 name: {{ include "common.name" . }}-perform-migration
136 {{- if include "common.onServiceMesh" . }}
137 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
138 bash docker-entrypoint.sh run_Migrations.sh -e UpdateAaiUriIndexMigration --commit --skipPreMigrationSnapShot --runDisabled RebuildAllEdges ;
139 {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
141 - name: LOCAL_USER_ID
142 value: {{ .Values.securityContext.user_id | quote }}
143 - name: LOCAL_GROUP_ID
144 value: {{ .Values.securityContext.group_id | quote }}
146 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
148 subPath: janusgraph-realtime.properties
149 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
151 subPath: janusgraph-cached.properties
152 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
154 subPath: aaiconfig.properties
155 - mountPath: /opt/aai/logroot/AAI-GA
157 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
160 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
162 subPath: localhost-access-logback.xml
163 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
165 subPath: application.properties
166 resources: {{ include "common.resources" . | nindent 10 }}
167 {{- if .Values.nodeSelector }}
168 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
170 {{- if .Values.affinity }}
171 affinity: {{ toYaml .Values.affinity | nindent 8 }}
173 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
175 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
176 - name: {{ include "common.fullname" . }}-logs
178 - name: {{ include "common.fullname" . }}-config
180 name: {{ include "common.fullname" . }}-configmap
181 - name: {{ include "common.fullname" . }}-snapshots
182 persistentVolumeClaim:
183 claimName: {{ include "common.fullname" . }}-migration
186 name: {{ include "common.fullname" . }}-properties
188 {{- include "common.imagePullSecrets" . | nindent 6 }}
193 name: {{ include "common.fullname" . }}-db-backup-job
194 namespace: {{ include "common.namespace" . }}
196 app: {{ include "common.name" . }}-db-backup-job
197 release: {{ include "common.release" . }}
198 heritage: {{ .Release.Service }}
199 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
201 "helm.sh/hook": pre-upgrade,pre-install
202 "helm.sh/hook-weight": "2"
203 "helm.sh/hook-delete-policy": before-hook-creation
209 app: {{ include "common.name" . }}-db-backup-job
210 release: {{ include "common.release" . }}
211 name: {{ include "common.name" . }}
214 {{ if eq .Values.global.jobs.migration.remoteCassandra.enabled false }}
218 - /app/ready.py --app-name aai-cassandra --timeout 1 || /app/ready.py --app-name cassandra
224 fieldPath: metadata.namespace
225 image: {{ include "repositoryGenerator.image.readiness" . }}
226 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
227 name: {{ include "common.name" . }}-db-backup-readiness
237 - name: {{ include "common.name" . }}-db-backup-job
238 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
239 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
245 {{- if include "common.onServiceMesh" . }}
246 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
247 bash docker-entrypoint.sh dataSnapshot.sh
248 {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
250 - name: LOCAL_USER_ID
251 value: {{ .Values.securityContext.user_id | quote }}
252 - name: LOCAL_GROUP_ID
253 value: {{ .Values.securityContext.group_id | quote }}
255 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
257 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
259 subPath: janusgraph-migration-real.properties
260 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
262 subPath: janusgraph-migration-cached.properties
263 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
265 subPath: aaiconfig.properties
266 - mountPath: /opt/aai/logroot/AAI-RES/
268 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
271 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
273 subPath: localhost-access-logback.xml
274 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
276 subPath: application.properties
277 resources: {{ include "common.resources" . | nindent 10 }}
278 {{- if .Values.nodeSelector }}
279 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
281 {{- if .Values.affinity }}
282 affinity: {{ toYaml .Values.affinity | nindent 8 }}
284 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
285 volumes: {{ include "common.resources" . | nindent 10 }}
290 name: {{ include "common.fullname" . }}
291 - name: properties-input
293 name: {{ include "common.fullname" . }}-properties
299 name: {{ include "common.fullname" . }}-migration
301 persistentVolumeClaim:
302 claimName: {{ include "common.fullname" . }}-migration
304 {{- include "common.imagePullSecrets" . | nindent 6 }}