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 - {{ .Values.global.cassandra.serviceName }}
75 fieldPath: metadata.namespace
76 image: {{ include "repositoryGenerator.image.readiness" . }}
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 name: {{ include "common.name" . }}-readiness
91 bash docker-entrypoint.sh dataRestoreFromSnapshot.sh `ls -t /opt/app/aai-graphadmin/logs/data/dataSnapshots|head -1|awk -F".P" '{ print $1 }'`
94 value: {{ .Values.securityContext.user_id | quote }}
95 - name: LOCAL_GROUP_ID
96 value: {{ .Values.securityContext.group_id | quote }}
98 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
100 subPath: janusgraph-realtime.properties
101 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
103 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
105 subPath: janusgraph-cached.properties
106 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
108 subPath: aaiconfig.properties
109 - mountPath: /opt/aai/logroot/AAI-GA
111 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
114 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
116 subPath: localhost-access-logback.xml
117 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
119 subPath: application.properties
120 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
121 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
122 name: {{ include "common.name" . }}-restore-backup
124 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
125 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
126 name: {{ include "common.name" . }}-perform-migration
132 {{- if include "common.onServiceMesh" . }}
133 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
134 bash docker-entrypoint.sh run_Migrations.sh -e UpdateAaiUriIndexMigration --commit --skipPreMigrationSnapShot --runDisabled RebuildAllEdges ;
135 {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
137 - name: LOCAL_USER_ID
138 value: {{ .Values.securityContext.user_id | quote }}
139 - name: LOCAL_GROUP_ID
140 value: {{ .Values.securityContext.group_id | quote }}
142 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
144 subPath: janusgraph-realtime.properties
145 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
147 subPath: janusgraph-cached.properties
148 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
150 subPath: aaiconfig.properties
151 - mountPath: /opt/aai/logroot/AAI-GA
153 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
156 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
158 subPath: localhost-access-logback.xml
159 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
161 subPath: application.properties
162 resources: {{ include "common.resources" . | nindent 10 }}
163 {{- if .Values.nodeSelector }}
164 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
166 {{- if .Values.affinity }}
167 affinity: {{ toYaml .Values.affinity | nindent 8 }}
169 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
171 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
172 - name: {{ include "common.fullname" . }}-logs
174 - name: {{ include "common.fullname" . }}-config
176 name: {{ include "common.fullname" . }}-configmap
177 - name: {{ include "common.fullname" . }}-snapshots
178 persistentVolumeClaim:
179 claimName: {{ include "common.fullname" . }}-migration
182 name: {{ include "common.fullname" . }}-properties
184 {{- include "common.imagePullSecrets" . | nindent 6 }}
189 name: {{ include "common.fullname" . }}-db-backup-job
190 namespace: {{ include "common.namespace" . }}
192 app: {{ include "common.name" . }}-db-backup-job
193 release: {{ include "common.release" . }}
194 heritage: {{ .Release.Service }}
195 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
197 "helm.sh/hook": pre-upgrade,pre-install
198 "helm.sh/hook-weight": "2"
199 "helm.sh/hook-delete-policy": before-hook-creation
205 app: {{ include "common.name" . }}-db-backup-job
206 release: {{ include "common.release" . }}
207 name: {{ include "common.name" . }}
210 {{ if eq .Values.global.jobs.migration.remoteCassandra.enabled false }}
214 - /app/ready.py --service-name {{ .Values.global.cassandra.serviceName }}
220 fieldPath: metadata.namespace
221 image: {{ include "repositoryGenerator.image.readiness" . }}
222 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
223 name: {{ include "common.name" . }}-db-backup-readiness
233 - name: {{ include "common.name" . }}-db-backup-job
234 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
235 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
241 {{- if include "common.onServiceMesh" . }}
242 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
243 bash docker-entrypoint.sh dataSnapshot.sh
244 {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
246 - name: LOCAL_USER_ID
247 value: {{ .Values.securityContext.user_id | quote }}
248 - name: LOCAL_GROUP_ID
249 value: {{ .Values.securityContext.group_id | quote }}
251 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
253 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
255 subPath: janusgraph-migration-real.properties
256 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
258 subPath: janusgraph-migration-cached.properties
259 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
261 subPath: aaiconfig.properties
262 - mountPath: /opt/aai/logroot/AAI-RES/
264 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
267 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
269 subPath: localhost-access-logback.xml
270 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
272 subPath: application.properties
273 resources: {{ include "common.resources" . | nindent 10 }}
274 {{- if .Values.nodeSelector }}
275 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
277 {{- if .Values.affinity }}
278 affinity: {{ toYaml .Values.affinity | nindent 8 }}
280 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
281 volumes: {{ include "common.resources" . | nindent 10 }}
286 name: {{ include "common.fullname" . }}
287 - name: properties-input
289 name: {{ include "common.fullname" . }}-properties
295 name: {{ include "common.fullname" . }}-migration
297 persistentVolumeClaim:
298 claimName: {{ include "common.fullname" . }}-migration
300 {{- include "common.imagePullSecrets" . | nindent 6 }}