2 # ============LICENSE_START=======================================================
4 # ================================================================================
5 # Copyright © 2018 AT&T Intellectual Property. All rights reserved.
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=========================================================
20 # In ONAP, the following job will always be run on each installation
21 # The following job will go through the latest oxm and
22 # create properties based on the data type defined in the oxm
23 # and create the required indexes for the appropriate properties
24 # This can be run multiple times as the code if the index or property already exists
25 # then the index or property won't be created again
26 # NOTE - During the execution of the createSchema job, there should
27 # be no other janusgraph connection to the graph as its the reason
28 # that resources traversal and graphadmin wait until this job is done
29 # If you are using an existing cassandra cluster not coming from oom
30 # then it is your job to ensure that there are no connections to the database
32 {{- if and ( not .Values.global.jobs.migration.enabled ) ( .Values.global.jobs.createSchema.enabled ) }}
36 name: {{ include "common.fullname" . }}-create-db-schema
37 namespace: {{ include "common.namespace" . }}
39 app: {{ include "common.name" . }}-job
40 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
41 release: {{ .Release.Name }}
42 heritage: {{ .Release.Service }}
48 app: {{ include "common.name" . }}-job
49 release: {{ .Release.Name }}
50 name: {{ include "common.name" . }}
57 {{- if .Values.global.cassandra.localCluster }}
69 fieldPath: metadata.namespace
70 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-readiness
74 - name: {{ include "common.name" . }}-job
75 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
76 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
79 - docker-entrypoint.sh
83 value: {{ .Values.global.config.userId | quote }}
84 - name: LOCAL_GROUP_ID
85 value: {{ .Values.global.config.groupId | quote }}
87 - mountPath: /etc/localtime
90 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
91 name: {{ include "common.fullname" . }}-config
92 subPath: janusgraph-realtime.properties
93 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
94 name: {{ include "common.fullname" . }}-config
95 subPath: janusgraph-cached.properties
96 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
97 name: {{ include "common.fullname" . }}-config
98 subPath: aaiconfig.properties
99 - mountPath: /opt/aai/logroot/AAI-GA
100 name: {{ include "common.fullname" . }}-logs
101 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
102 name: {{ include "common.fullname" . }}-config
104 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
105 name: {{ include "common.fullname" . }}-config
106 subPath: localhost-access-logback.xml
107 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
108 name: {{ include "common.fullname" . }}-config
109 subPath: application.properties
111 {{ range $job := .Values.global.config.auth.files }}
112 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
113 name: {{ include "common.fullname" $global }}-auth-truststore-sec
117 {{ include "common.resources" . }}
118 {{- if .Values.nodeSelector }}
120 {{ toYaml .Values.nodeSelector | indent 8 }}
122 {{- if .Values.affinity }}
124 {{ toYaml .Values.affinity | indent 8 }}
130 - name: filebeat-conf
133 - name: {{ include "common.fullname" . }}-logs
135 path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}-create-db-schema
136 - name: {{ include "common.fullname" . }}-config
138 name: {{ include "common.fullname" . }}-configmap
139 - name: {{ include "common.fullname" . }}-auth-truststore-sec
141 secretName: aai-common-truststore
143 {{ range $job := .Values.global.config.auth.files }}
149 - name: "{{ include "common.namespace" . }}-docker-registry-key"
151 {{- if .Values.global.jobs.migration.enabled }}
156 name: {{ include "common.fullname" . }}-migration
157 namespace: {{ include "common.namespace" . }}
159 app: {{ include "common.name" . }}-job
160 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
161 release: {{ .Release.Name }}
162 heritage: {{ .Release.Service }}
164 "helm.sh/hook": post-upgrade,post-rollback,post-install
165 "helm.sh/hook-weight": "1"
166 "helm.sh/hook-delete-policy": before-hook-creation
172 app: {{ include "common.name" . }}-job
173 release: {{ .Release.Name }}
174 name: {{ include "common.name" . }}
181 {{- if .Values.global.cassandra.localCluster }}
193 fieldPath: metadata.namespace
194 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
195 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
196 name: {{ include "common.name" . }}-readiness
200 - bash docker-entrypoint.sh dataRestoreFromSnapshot.sh `ls -t /opt/app/aai-graphadmin/logs/data/dataSnapshots|head -1|awk -F".P" '{ print $1 }'`
202 - name: LOCAL_USER_ID
203 value: {{ .Values.global.config.userId | quote }}
204 - name: LOCAL_GROUP_ID
205 value: {{ .Values.global.config.groupId | quote }}
207 - mountPath: /etc/localtime
210 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
211 name: {{ include "common.fullname" . }}-config
212 subPath: janusgraph-realtime.properties
213 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
214 name: {{ include "common.fullname" . }}-snapshots
215 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
216 name: {{ include "common.fullname" . }}-config
217 subPath: janusgraph-cached.properties
218 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
219 name: {{ include "common.fullname" . }}-config
220 subPath: aaiconfig.properties
221 - mountPath: /opt/aai/logroot/AAI-GA
222 name: {{ include "common.fullname" . }}-logs
223 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
224 name: {{ include "common.fullname" . }}-config
226 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
227 name: {{ include "common.fullname" . }}-config
228 subPath: localhost-access-logback.xml
229 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
230 name: {{ include "common.fullname" . }}-config
231 subPath: application.properties
233 {{ range $job := .Values.global.config.auth.files }}
234 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
235 name: {{ include "common.fullname" $global }}-auth-truststore-sec
238 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
239 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
240 name: {{ include "common.name" . }}-restore-backup
242 - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
243 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
244 name: {{ include "common.name" . }}-perform-migration
248 - bash docker-entrypoint.sh run_Migrations.sh -e UpdateAaiUriIndexMigration --commit --skipPreMigrationSnapShot --runDisabled RebuildAllEdges
250 - name: LOCAL_USER_ID
251 value: {{ .Values.global.config.userId | quote }}
252 - name: LOCAL_GROUP_ID
253 value: {{ .Values.global.config.groupId | quote }}
255 - mountPath: /etc/localtime
258 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
259 name: {{ include "common.fullname" . }}-config
260 subPath: janusgraph-realtime.properties
261 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
262 name: {{ include "common.fullname" . }}-config
263 subPath: janusgraph-cached.properties
264 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
265 name: {{ include "common.fullname" . }}-config
266 subPath: aaiconfig.properties
267 - mountPath: /opt/aai/logroot/AAI-GA
268 name: {{ include "common.fullname" . }}-logs
269 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
270 name: {{ include "common.fullname" . }}-config
272 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
273 name: {{ include "common.fullname" . }}-config
274 subPath: localhost-access-logback.xml
275 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
276 name: {{ include "common.fullname" . }}-config
277 subPath: application.properties
279 {{ range $job := .Values.global.config.auth.files }}
280 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
281 name: {{ include "common.fullname" $global }}-auth-truststore-sec
285 {{ include "common.resources" . }}
286 {{- if .Values.nodeSelector }}
288 {{ toYaml .Values.nodeSelector | indent 8 }}
290 {{- if .Values.affinity }}
292 {{ toYaml .Values.affinity | indent 8 }}
298 - name: filebeat-conf
301 - name: {{ include "common.fullname" . }}-logs
303 - name: {{ include "common.fullname" . }}-config
305 name: {{ include "common.fullname" . }}-configmap
306 - name: {{ include "common.fullname" . }}-snapshots
307 persistentVolumeClaim:
308 claimName: {{ include "common.fullname" . }}-migration
309 - name: {{ include "common.fullname" . }}-auth-truststore-sec
311 secretName: aai-common-truststore
313 {{ range $job := .Values.global.config.auth.files }}
319 - name: "{{ include "common.namespace" . }}-docker-registry-key"
324 name: {{ include "common.fullname" . }}-db-backup-job
325 namespace: {{ include "common.namespace" . }}
327 app: {{ include "common.name" . }}-db-backup-job
328 release: {{ .Release.Name }}
329 heritage: {{ .Release.Service }}
330 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
332 "helm.sh/hook": pre-upgrade,pre-install
333 "helm.sh/hook-weight": "2"
334 "helm.sh/hook-delete-policy": before-hook-creation
340 app: {{ include "common.name" . }}-db-backup-job
341 release: {{ .Release.Name }}
342 name: {{ include "common.name" . }}
344 {{ if eq .Values.global.jobs.migration.remoteCassandra.enabled false }}
349 - /root/ready.py --container-name aai-cassandra --timeout 1 || /root/ready.py --container-name cassandra
355 fieldPath: metadata.namespace
356 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
357 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
358 name: {{ include "common.name" . }}-db-backup-readiness
361 - name: {{ include "common.name" . }}-db-backup-job
362 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
363 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
366 - docker-entrypoint.sh
369 - name: LOCAL_USER_ID
370 value: {{ .Values.global.config.userId | quote }}
371 - name: LOCAL_GROUP_ID
372 value: {{ .Values.global.config.groupId | quote }}
374 - mountPath: /etc/localtime
377 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
378 name: {{ include "common.fullname" . }}-snapshots
379 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
380 name: {{ include "common.fullname" . }}-migration
381 subPath: janusgraph-migration-real.properties
382 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
383 name: {{ include "common.fullname" . }}-migration
384 subPath: janusgraph-migration-cached.properties
385 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
386 name: {{ include "common.fullname" . }}-config
387 subPath: aaiconfig.properties
388 - mountPath: /opt/aai/logroot/AAI-RES/
389 name: {{ include "common.fullname" . }}-logs
390 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
391 name: {{ include "common.fullname" . }}-config
393 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
394 name: {{ include "common.fullname" . }}-config
395 subPath: localhost-access-logback.xml
396 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
397 name: {{ include "common.fullname" . }}-config
398 subPath: application.properties
400 {{ include "common.resources" . | indent 10 }}
401 {{- if .Values.nodeSelector }}
403 {{ toYaml .Values.nodeSelector | indent 8 }}
405 {{- if .Values.affinity }}
407 {{ toYaml .Values.affinity | indent 8 }}
413 - name: {{ include "common.fullname" . }}-logs
415 - name: {{ include "common.fullname" . }}-config
417 name: {{ include "common.fullname" . }}-configmap
418 - name: {{ include "common.fullname" . }}-migration
420 name: {{ include "common.fullname" . }}-migration-configmap
421 - name: {{ include "common.fullname" . }}-snapshots
422 persistentVolumeClaim:
423 claimName: {{ include "common.fullname" . }}-migration
426 - name: "{{ include "common.namespace" . }}-docker-registry-key"