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 Orange Intellectual Property. All rights reserved.
9 # ================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
14 # http://www.apache.org/licenses/LICENSE-2.0
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END=========================================================
23 # In ONAP, the following job will always be run on each installation
24 # The following job will go through the latest oxm and
25 # create properties based on the data type defined in the oxm
26 # and create the required indexes for the appropriate properties
27 # This can be run multiple times as the code if the index or property already exists
28 # then the index or property won't be created again
29 # NOTE - During the execution of the createSchema job, there should
30 # be no other janusgraph connection to the graph as its the reason
31 # that resources traversal and graphadmin wait until this job is done
32 # If you are using an existing cassandra cluster not coming from oom
33 # then it is your job to ensure that there are no connections to the database
36 {{- if .Values.global.jobs.migration.enabled }}
41 name: {{ include "common.fullname" . }}-migration
42 namespace: {{ include "common.namespace" . }}
44 app: {{ include "common.name" . }}-job
45 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
46 release: {{ include "common.release" . }}
47 heritage: {{ .Release.Service }}
49 "helm.sh/hook": post-upgrade,post-rollback,post-install
50 "helm.sh/hook-weight": "1"
51 "helm.sh/hook-delete-policy": before-hook-creation
57 app: {{ include "common.name" . }}-job
58 release: {{ include "common.release" . }}
59 name: {{ include "common.name" . }}
66 {{- if .Values.global.cassandra.localCluster }}
78 fieldPath: metadata.namespace
79 image: {{ include "repositoryGenerator.image.readiness" . }}
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 name: {{ include "common.name" . }}-readiness
85 - bash docker-entrypoint.sh dataRestoreFromSnapshot.sh `ls -t /opt/app/aai-graphadmin/logs/data/dataSnapshots|head -1|awk -F".P" '{ print $1 }'`
88 value: {{ .Values.global.config.userId | quote }}
89 - name: LOCAL_GROUP_ID
90 value: {{ .Values.global.config.groupId | quote }}
92 - mountPath: /etc/localtime
95 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
96 name: {{ include "common.fullname" . }}-config
97 subPath: janusgraph-realtime.properties
98 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
99 name: {{ include "common.fullname" . }}-snapshots
100 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
101 name: {{ include "common.fullname" . }}-config
102 subPath: janusgraph-cached.properties
103 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
104 name: {{ include "common.fullname" . }}-config
105 subPath: aaiconfig.properties
106 - mountPath: /opt/aai/logroot/AAI-GA
107 name: {{ include "common.fullname" . }}-logs
108 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
109 name: {{ include "common.fullname" . }}-config
111 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
112 name: {{ include "common.fullname" . }}-config
113 subPath: localhost-access-logback.xml
114 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
115 name: {{ include "common.fullname" . }}-config
116 subPath: application.properties
118 {{ range $job := .Values.global.config.auth.files }}
119 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
120 name: {{ include "common.fullname" $global }}-auth-truststore-sec
123 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
124 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
125 name: {{ include "common.name" . }}-restore-backup
127 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
128 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
129 name: {{ include "common.name" . }}-perform-migration
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.global.config.userId | quote }}
139 - name: LOCAL_GROUP_ID
140 value: {{ .Values.global.config.groupId | quote }}
142 - mountPath: /etc/localtime
145 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
146 name: {{ include "common.fullname" . }}-config
147 subPath: janusgraph-realtime.properties
148 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
149 name: {{ include "common.fullname" . }}-config
150 subPath: janusgraph-cached.properties
151 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
152 name: {{ include "common.fullname" . }}-config
153 subPath: aaiconfig.properties
154 - mountPath: /opt/aai/logroot/AAI-GA
155 name: {{ include "common.fullname" . }}-logs
156 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
157 name: {{ include "common.fullname" . }}-config
159 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
160 name: {{ include "common.fullname" . }}-config
161 subPath: localhost-access-logback.xml
162 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
163 name: {{ include "common.fullname" . }}-config
164 subPath: application.properties
166 {{ range $job := .Values.global.config.auth.files }}
167 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
168 name: {{ include "common.fullname" $global }}-auth-truststore-sec
172 {{ include "common.resources" . }}
173 {{- if .Values.nodeSelector }}
175 {{ toYaml .Values.nodeSelector | indent 8 }}
177 {{- if .Values.affinity }}
179 {{ toYaml .Values.affinity | indent 8 }}
185 - name: filebeat-conf
188 - name: {{ include "common.fullname" . }}-logs
190 - name: {{ include "common.fullname" . }}-config
192 name: {{ include "common.fullname" . }}-configmap
193 - name: {{ include "common.fullname" . }}-snapshots
194 persistentVolumeClaim:
195 claimName: {{ include "common.fullname" . }}-migration
196 - name: {{ include "common.fullname" . }}-auth-truststore-sec
198 secretName: aai-common-truststore
200 {{ range $job := .Values.global.config.auth.files }}
206 - name: "{{ include "common.namespace" . }}-docker-registry-key"
211 name: {{ include "common.fullname" . }}-db-backup-job
212 namespace: {{ include "common.namespace" . }}
214 app: {{ include "common.name" . }}-db-backup-job
215 release: {{ include "common.release" . }}
216 heritage: {{ .Release.Service }}
217 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
219 "helm.sh/hook": pre-upgrade,pre-install
220 "helm.sh/hook-weight": "2"
221 "helm.sh/hook-delete-policy": before-hook-creation
227 app: {{ include "common.name" . }}-db-backup-job
228 release: {{ include "common.release" . }}
229 name: {{ include "common.name" . }}
231 {{ if eq .Values.global.jobs.migration.remoteCassandra.enabled false }}
236 - /app/ready.py --container-name aai-cassandra --timeout 1 || /app/ready.py --container-name cassandra
242 fieldPath: metadata.namespace
243 image: {{ include "repositoryGenerator.image.readiness" . }}
244 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
245 name: {{ include "common.name" . }}-db-backup-readiness
248 - name: {{ include "common.name" . }}-db-backup-job
249 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
250 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
255 bash docker-entrypoint.sh dataSnapshot.sh ;
256 {{- include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
258 - name: LOCAL_USER_ID
259 value: {{ .Values.global.config.userId | quote }}
260 - name: LOCAL_GROUP_ID
261 value: {{ .Values.global.config.groupId | quote }}
263 - mountPath: /etc/localtime
266 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
267 name: {{ include "common.fullname" . }}-snapshots
268 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
269 name: {{ include "common.fullname" . }}-migration
270 subPath: janusgraph-migration-real.properties
271 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
272 name: {{ include "common.fullname" . }}-migration
273 subPath: janusgraph-migration-cached.properties
274 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
275 name: {{ include "common.fullname" . }}-config
276 subPath: aaiconfig.properties
277 - mountPath: /opt/aai/logroot/AAI-RES/
278 name: {{ include "common.fullname" . }}-logs
279 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
280 name: {{ include "common.fullname" . }}-config
282 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
283 name: {{ include "common.fullname" . }}-config
284 subPath: localhost-access-logback.xml
285 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
286 name: {{ include "common.fullname" . }}-config
287 subPath: application.properties
289 {{ include "common.resources" . | indent 10 }}
290 {{- if .Values.nodeSelector }}
292 {{ toYaml .Values.nodeSelector | indent 8 }}
294 {{- if .Values.affinity }}
296 {{ toYaml .Values.affinity | indent 8 }}
302 - name: {{ include "common.fullname" . }}-logs
304 - name: {{ include "common.fullname" . }}-config
306 name: {{ include "common.fullname" . }}-configmap
307 - name: {{ include "common.fullname" . }}-migration
309 name: {{ include "common.fullname" . }}-migration-configmap
310 - name: {{ include "common.fullname" . }}-snapshots
311 persistentVolumeClaim:
312 claimName: {{ include "common.fullname" . }}-migration
315 - name: "{{ include "common.namespace" . }}-docker-registry-key"