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: /etc/localtime
105 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
107 subPath: janusgraph-realtime.properties
108 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
110 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
112 subPath: janusgraph-cached.properties
113 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
115 subPath: aaiconfig.properties
116 - mountPath: /opt/aai/logroot/AAI-GA
118 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
121 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
123 subPath: localhost-access-logback.xml
124 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
126 subPath: application.properties
127 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
128 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
129 name: {{ include "common.name" . }}-restore-backup
131 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
132 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
133 name: {{ include "common.name" . }}-perform-migration
139 {{- if include "common.onServiceMesh" . }}
140 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
141 bash docker-entrypoint.sh run_Migrations.sh -e UpdateAaiUriIndexMigration --commit --skipPreMigrationSnapShot --runDisabled RebuildAllEdges ;
142 {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
144 - name: LOCAL_USER_ID
145 value: {{ .Values.securityContext.user_id | quote }}
146 - name: LOCAL_GROUP_ID
147 value: {{ .Values.securityContext.group_id | quote }}
149 - mountPath: /etc/localtime
152 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
154 subPath: janusgraph-realtime.properties
155 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
157 subPath: janusgraph-cached.properties
158 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
160 subPath: aaiconfig.properties
161 - mountPath: /opt/aai/logroot/AAI-GA
163 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
166 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
168 subPath: localhost-access-logback.xml
169 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
171 subPath: application.properties
172 resources: {{ include "common.resources" . | nindent 10 }}
173 {{- if .Values.nodeSelector }}
174 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
176 {{- if .Values.affinity }}
177 affinity: {{ toYaml .Values.affinity | nindent 8 }}
179 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
184 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
185 - name: {{ include "common.fullname" . }}-logs
187 - name: {{ include "common.fullname" . }}-config
189 name: {{ include "common.fullname" . }}-configmap
190 - name: {{ include "common.fullname" . }}-snapshots
191 persistentVolumeClaim:
192 claimName: {{ include "common.fullname" . }}-migration
195 name: {{ include "common.fullname" . }}-properties
198 - name: "{{ include "common.namespace" . }}-docker-registry-key"
203 name: {{ include "common.fullname" . }}-db-backup-job
204 namespace: {{ include "common.namespace" . }}
206 app: {{ include "common.name" . }}-db-backup-job
207 release: {{ include "common.release" . }}
208 heritage: {{ .Release.Service }}
209 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
211 "helm.sh/hook": pre-upgrade,pre-install
212 "helm.sh/hook-weight": "2"
213 "helm.sh/hook-delete-policy": before-hook-creation
219 app: {{ include "common.name" . }}-db-backup-job
220 release: {{ include "common.release" . }}
221 name: {{ include "common.name" . }}
224 {{ if eq .Values.global.jobs.migration.remoteCassandra.enabled false }}
228 - /app/ready.py --app-name aai-cassandra --timeout 1 || /app/ready.py --app-name cassandra
234 fieldPath: metadata.namespace
235 image: {{ include "repositoryGenerator.image.readiness" . }}
236 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
237 name: {{ include "common.name" . }}-db-backup-readiness
247 - name: {{ include "common.name" . }}-db-backup-job
248 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
249 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
255 {{- if include "common.onServiceMesh" . }}
256 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
257 bash docker-entrypoint.sh dataSnapshot.sh
258 {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
260 - name: LOCAL_USER_ID
261 value: {{ .Values.securityContext.user_id | quote }}
262 - name: LOCAL_GROUP_ID
263 value: {{ .Values.securityContext.group_id | quote }}
265 - mountPath: /etc/localtime
268 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
270 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
272 subPath: janusgraph-migration-real.properties
273 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
275 subPath: janusgraph-migration-cached.properties
276 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
278 subPath: aaiconfig.properties
279 - mountPath: /opt/aai/logroot/AAI-RES/
281 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
284 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
286 subPath: localhost-access-logback.xml
287 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
289 subPath: application.properties
290 resources: {{ include "common.resources" . | nindent 10 }}
291 {{- if .Values.nodeSelector }}
292 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
294 {{- if .Values.affinity }}
295 affinity: {{ toYaml .Values.affinity | nindent 8 }}
297 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
298 volumes: {{ include "common.resources" . | nindent 10 }}
306 name: {{ include "common.fullname" . }}
307 - name: properties-input
309 name: {{ include "common.fullname" . }}-properties
315 name: {{ include "common.fullname" . }}-migration
317 persistentVolumeClaim:
318 claimName: {{ include "common.fullname" . }}-migration
321 - name: "{{ include "common.namespace" . }}-docker-registry-key"