Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 2 | # |
| 3 | # ============LICENSE_START======================================================= |
| 4 | # org.onap.aai |
| 5 | # ================================================================================ |
| 6 | # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. |
| 7 | # Copyright (c) 2020 Nokia Intellectual Property. All rights reserved. |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 8 | # Copyright (c) 2020-2021 Orange Intellectual Property. All rights reserved. |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame^] | 9 | # Modifications Copyright © 2023 Nordix Foundation |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 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 |
| 14 | # |
| 15 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 16 | # |
| 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========================================================= |
| 23 | |
| 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 |
Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 35 | */}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 36 | |
| 37 | {{- if and ( not .Values.global.jobs.migration.enabled ) ( .Values.global.jobs.createSchema.enabled ) }} |
| 38 | apiVersion: batch/v1 |
| 39 | kind: Job |
| 40 | metadata: |
| 41 | name: {{ include "common.fullname" . }}-create-db-schema |
| 42 | namespace: {{ include "common.namespace" . }} |
| 43 | labels: |
| 44 | app: {{ include "common.name" . }}-job |
| 45 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 46 | release: {{ include "common.release" . }} |
| 47 | heritage: {{ .Release.Service }} |
| 48 | spec: |
| 49 | backoffLimit: 20 |
| 50 | template: |
| 51 | metadata: |
| 52 | labels: |
| 53 | app: {{ include "common.name" . }}-job |
| 54 | release: {{ include "common.release" . }} |
| 55 | name: {{ include "common.name" . }} |
| 56 | spec: |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame^] | 57 | initContainers: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 58 | - command: |
| 59 | - /app/ready.py |
| 60 | args: |
| 61 | - --container-name |
| 62 | {{- if .Values.global.cassandra.localCluster }} |
| 63 | - aai-cassandra |
| 64 | {{- else }} |
| 65 | - cassandra |
| 66 | {{- end }} |
| 67 | - --container-name |
| 68 | - aai-schema-service |
| 69 | env: |
| 70 | - name: NAMESPACE |
| 71 | valueFrom: |
| 72 | fieldRef: |
| 73 | apiVersion: v1 |
| 74 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 75 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 76 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 77 | name: {{ include "common.name" . }}-readiness |
| 78 | containers: |
| 79 | - name: {{ include "common.name" . }}-job |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 80 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 81 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 82 | command: |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 83 | - sh |
| 84 | args: |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 85 | - -c |
| 86 | - | |
Andreas Geissler | 8624d22 | 2022-05-13 17:16:41 +0200 | [diff] [blame] | 87 | {{- if include "common.onServiceMesh" . }} |
| 88 | echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }} |
| 89 | bash docker-entrypoint.sh createDBSchema.sh; |
othman touijer | 5117667 | 2021-12-01 16:21:18 +0100 | [diff] [blame] | 90 | {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 91 | env: |
| 92 | - name: LOCAL_USER_ID |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 93 | value: {{ .Values.securityContext.user_id | quote }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 94 | - name: LOCAL_GROUP_ID |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 95 | value: {{ .Values.securityContext.group_id | quote }} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame^] | 96 | volumeMounts: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 97 | - mountPath: /etc/localtime |
| 98 | name: localtime |
| 99 | readOnly: true |
| 100 | - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 101 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 102 | subPath: janusgraph-realtime.properties |
| 103 | - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 104 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 105 | subPath: janusgraph-cached.properties |
| 106 | - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 107 | name: properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 108 | subPath: aaiconfig.properties |
| 109 | - mountPath: /opt/aai/logroot/AAI-GA |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 110 | name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 111 | - mountPath: /opt/app/aai-graphadmin/resources/logback.xml |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 112 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 113 | subPath: logback.xml |
| 114 | - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 115 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 116 | subPath: localhost-access-logback.xml |
| 117 | - mountPath: /opt/app/aai-graphadmin/resources/application.properties |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 118 | name: properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 119 | subPath: application.properties |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 120 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 121 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 122 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 123 | {{- end }} |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 124 | {{- if .Values.affinity }} |
| 125 | affinity: {{ toYaml .Values.affinity | nindent 8 }} |
| 126 | {{- end }} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame^] | 127 | volumes: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 128 | - name: localtime |
| 129 | hostPath: |
| 130 | path: /etc/localtime |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 131 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 132 | - name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 133 | emptyDir: {} |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 134 | - name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 135 | configMap: |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 136 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 137 | - name: properties |
othman touijer | 5117667 | 2021-12-01 16:21:18 +0100 | [diff] [blame] | 138 | configMap: |
| 139 | name: {{ include "common.fullname" . }}-properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 140 | restartPolicy: Never |
| 141 | imagePullSecrets: |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 142 | - name: {{ include "common.namespace" . }}-docker-registry-key |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 143 | {{ end }} |