1 {{- if .Values.dgbuilder.enabled -}}
3 # Copyright © 2017 Amdocs, Bell Canada, AT&T
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 name: {{ include "common.fullname" . }}-dbinit-job
22 namespace: {{ include "common.namespace" . }}
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26 release: {{ include "common.release" . }}
27 heritage: {{ .Release.Service }}
33 app: {{ include "common.name" . }}-job
34 release: {{ include "common.release" . }}
35 name: {{ include "common.name" . }}
42 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
44 - name: AAI_CLIENT_NAME
45 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
46 - name: AAI_CLIENT_PASSWORD
47 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
48 - name: MODELSERVICE_USER
49 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
50 - name: MODELSERVICE_PASSWORD
51 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
54 - name: RESTCONF_PASSWORD
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
57 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
58 - name: ANSIBLE_PASSWORD
59 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
61 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
62 - name: SCALEOUT_PASSWORD
63 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
65 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
67 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
68 - name: SDNC_DB_PASSWORD
69 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
71 - mountPath: /config-input
75 image: {{ include "repositoryGenerator.image.envsubst" . }}
76 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77 name: {{ include "common.name" . }}-update-config
79 {{- if .Values.global.mariadbGalera.localCluster }}
80 {{- if .Values.global.mariadbGalera.useOperator }}
81 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local_operator ) | indent 6 | trim }}
83 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local ) | indent 6 | trim }}
86 {{- if .Values.global.mariadbGalera.useOperator }}
87 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global_operator ) | indent 6 | trim }}
89 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global ) | indent 6 | trim }}
93 - name: {{ include "common.name" . }}
94 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
95 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
97 - name: MYSQL_ROOT_PASSWORD
98 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
99 - name: ODL_ADMIN_USERNAME
100 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
101 - name: ODL_ADMIN_PASSWORD
102 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
104 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
105 - name: SDNC_DB_PASSWORD
106 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
108 value: {{ include "common.mariadbService" . }}
110 value: "{{.Values.config.sdncHome}}"
112 value: "{{.Values.config.etcDir}}"
114 value: "{{.Values.config.binDir}}"
115 - name: SDNC_DB_DATABASE
116 value: "{{.Values.config.dbSdnctlDatabase}}"
118 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
120 subPath: installSdncDb.sh
121 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
123 subPath: svclogic.properties
124 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
126 subPath: svclogic.properties
127 - mountPath: {{ .Values.config.configDir }}/dblib.properties
129 subPath: dblib.properties
135 sleep 60; {{.Values.config.binDir }}/installSdncDb.sh
136 resources: {{ include "common.resources" . | nindent 10 }}
137 {{- if include "common.onServiceMesh" . }}
138 - name: sdnc-service-mesh-wait-for-job-container
139 image: {{ include "repositoryGenerator.image.quitQuit" . }}
140 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
146 echo "waiting 20s for istio side cars to be up"; sleep 20s;
147 /app/ready.py --service-mesh-check sdnc -t 45;
153 fieldPath: metadata.namespace
155 {{- if .Values.nodeSelector }}
156 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
158 {{- if .Values.affinity }}
159 affinity: {{ toYaml .Values.affinity | nindent 8 }}
161 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
166 - name: docker-entrypoint-initdb-d
170 name: {{ include "common.fullname" . }}-bin
174 name: {{ include "common.fullname" . }}-properties
180 {{- include "common.imagePullSecrets" . | nindent 6 }}