2 # ============LICENSE_START=======================================================
4 # ================================================================================
5 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 # Copyright (c) 2020 Nokia Intellectual Property. All rights reserved.
7 # ================================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END=========================================================
21 # In ONAP, the following job will always be run on each installation
22 # The following job will go through the latest oxm and
23 # create properties based on the data type defined in the oxm
24 # and create the required indexes for the appropriate properties
25 # This can be run multiple times as the code if the index or property already exists
26 # then the index or property won't be created again
27 # NOTE - During the execution of the createSchema job, there should
28 # be no other janusgraph connection to the graph as its the reason
29 # that resources traversal and graphadmin wait until this job is done
30 # If you are using an existing cassandra cluster not coming from oom
31 # then it is your job to ensure that there are no connections to the database
33 {{- if .Values.global.jobs.migration.enabled }}
38 name: {{ include "common.fullname" . }}-migration
39 namespace: {{ include "common.namespace" . }}
41 app: {{ include "common.name" . }}-job
42 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
43 release: {{ include "common.release" . }}
44 heritage: {{ .Release.Service }}
46 "helm.sh/hook": post-upgrade,post-rollback,post-install
47 "helm.sh/hook-weight": "1"
48 "helm.sh/hook-delete-policy": before-hook-creation
54 app: {{ include "common.name" . }}-job
55 release: {{ include "common.release" . }}
56 name: {{ include "common.name" . }}
63 {{- if .Values.global.cassandra.localCluster }}
75 fieldPath: metadata.namespace
76 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 name: {{ include "common.name" . }}-readiness
82 - bash docker-entrypoint.sh dataRestoreFromSnapshot.sh `ls -t /opt/app/aai-graphadmin/logs/data/dataSnapshots|head -1|awk -F".P" '{ print $1 }'`
85 value: {{ .Values.global.config.userId | quote }}
86 - name: LOCAL_GROUP_ID
87 value: {{ .Values.global.config.groupId | quote }}
89 - mountPath: /etc/localtime
92 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
93 name: {{ include "common.fullname" . }}-config
94 subPath: janusgraph-realtime.properties
95 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
96 name: {{ include "common.fullname" . }}-snapshots
97 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
98 name: {{ include "common.fullname" . }}-config
99 subPath: janusgraph-cached.properties
100 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
101 name: {{ include "common.fullname" . }}-config
102 subPath: aaiconfig.properties
103 - mountPath: /opt/aai/logroot/AAI-GA
104 name: {{ include "common.fullname" . }}-logs
105 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
106 name: {{ include "common.fullname" . }}-config
108 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
109 name: {{ include "common.fullname" . }}-config
110 subPath: localhost-access-logback.xml
111 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
112 name: {{ include "common.fullname" . }}-config
113 subPath: application.properties
115 {{ range $job := .Values.global.config.auth.files }}
116 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
117 name: {{ include "common.fullname" $global }}-auth-truststore-sec
120 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
121 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
122 name: {{ include "common.name" . }}-restore-backup
124 - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
125 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
126 name: {{ include "common.name" . }}-perform-migration
130 - bash docker-entrypoint.sh run_Migrations.sh -e UpdateAaiUriIndexMigration --commit --skipPreMigrationSnapShot --runDisabled RebuildAllEdges
132 - name: LOCAL_USER_ID
133 value: {{ .Values.global.config.userId | quote }}
134 - name: LOCAL_GROUP_ID
135 value: {{ .Values.global.config.groupId | quote }}
137 - mountPath: /etc/localtime
140 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
141 name: {{ include "common.fullname" . }}-config
142 subPath: janusgraph-realtime.properties
143 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
144 name: {{ include "common.fullname" . }}-config
145 subPath: janusgraph-cached.properties
146 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
147 name: {{ include "common.fullname" . }}-config
148 subPath: aaiconfig.properties
149 - mountPath: /opt/aai/logroot/AAI-GA
150 name: {{ include "common.fullname" . }}-logs
151 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
152 name: {{ include "common.fullname" . }}-config
154 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
155 name: {{ include "common.fullname" . }}-config
156 subPath: localhost-access-logback.xml
157 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
158 name: {{ include "common.fullname" . }}-config
159 subPath: application.properties
161 {{ range $job := .Values.global.config.auth.files }}
162 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
163 name: {{ include "common.fullname" $global }}-auth-truststore-sec
167 {{ include "common.resources" . }}
168 {{- if .Values.nodeSelector }}
170 {{ toYaml .Values.nodeSelector | indent 8 }}
172 {{- if .Values.affinity }}
174 {{ toYaml .Values.affinity | indent 8 }}
180 - name: filebeat-conf
183 - name: {{ include "common.fullname" . }}-logs
185 - name: {{ include "common.fullname" . }}-config
187 name: {{ include "common.fullname" . }}-configmap
188 - name: {{ include "common.fullname" . }}-snapshots
189 persistentVolumeClaim:
190 claimName: {{ include "common.fullname" . }}-migration
191 - name: {{ include "common.fullname" . }}-auth-truststore-sec
193 secretName: aai-common-truststore
195 {{ range $job := .Values.global.config.auth.files }}
201 - name: "{{ include "common.namespace" . }}-docker-registry-key"
206 name: {{ include "common.fullname" . }}-db-backup-job
207 namespace: {{ include "common.namespace" . }}
209 app: {{ include "common.name" . }}-db-backup-job
210 release: {{ include "common.release" . }}
211 heritage: {{ .Release.Service }}
212 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
214 "helm.sh/hook": pre-upgrade,pre-install
215 "helm.sh/hook-weight": "2"
216 "helm.sh/hook-delete-policy": before-hook-creation
222 app: {{ include "common.name" . }}-db-backup-job
223 release: {{ include "common.release" . }}
224 name: {{ include "common.name" . }}
226 {{ if eq .Values.global.jobs.migration.remoteCassandra.enabled false }}
231 - /app/ready.py --container-name aai-cassandra --timeout 1 || /app/ready.py --container-name cassandra
237 fieldPath: metadata.namespace
238 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
239 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
240 name: {{ include "common.name" . }}-db-backup-readiness
243 - name: {{ include "common.name" . }}-db-backup-job
244 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
245 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
248 - docker-entrypoint.sh
251 - name: LOCAL_USER_ID
252 value: {{ .Values.global.config.userId | quote }}
253 - name: LOCAL_GROUP_ID
254 value: {{ .Values.global.config.groupId | quote }}
256 - mountPath: /etc/localtime
259 - mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
260 name: {{ include "common.fullname" . }}-snapshots
261 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
262 name: {{ include "common.fullname" . }}-migration
263 subPath: janusgraph-migration-real.properties
264 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
265 name: {{ include "common.fullname" . }}-migration
266 subPath: janusgraph-migration-cached.properties
267 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
268 name: {{ include "common.fullname" . }}-config
269 subPath: aaiconfig.properties
270 - mountPath: /opt/aai/logroot/AAI-RES/
271 name: {{ include "common.fullname" . }}-logs
272 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
273 name: {{ include "common.fullname" . }}-config
275 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
276 name: {{ include "common.fullname" . }}-config
277 subPath: localhost-access-logback.xml
278 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
279 name: {{ include "common.fullname" . }}-config
280 subPath: application.properties
282 {{ include "common.resources" . | indent 10 }}
283 {{- if .Values.nodeSelector }}
285 {{ toYaml .Values.nodeSelector | indent 8 }}
287 {{- if .Values.affinity }}
289 {{ toYaml .Values.affinity | indent 8 }}
295 - name: {{ include "common.fullname" . }}-logs
297 - name: {{ include "common.fullname" . }}-config
299 name: {{ include "common.fullname" . }}-configmap
300 - name: {{ include "common.fullname" . }}-migration
302 name: {{ include "common.fullname" . }}-migration-configmap
303 - name: {{ include "common.fullname" . }}-snapshots
304 persistentVolumeClaim:
305 claimName: {{ include "common.fullname" . }}-migration
308 - name: "{{ include "common.namespace" . }}-docker-registry-key"