2 # Copyright © 2020 highstreet technologies GmbH
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 {{ if .Values.config.sdnr.enabled -}}
19 metadata: {{- include "common.resourceMetadata" (dict "suffix" "sdnrdb-init-job" "dot" . ) | nindent 2 }}
23 metadata: {{ include "common.templateMetadata" . | indent 6}}
26 - name: {{ include "common.name" . }}-readiness
30 {{- if .Values.config.sdnr.mariadb.enabled }}
32 - {{ include "common.mariadbService" . }}
35 - {{.Values.elasticsearch.nameOverride}}-elasticsearch
37 - {{.Values.elasticsearch.nameOverride}}-nginx
39 - {{.Values.elasticsearch.nameOverride}}-master
46 fieldPath: metadata.namespace
47 image: {{ include "repositoryGenerator.image.readiness" . }}
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50 - name: {{ include "common.name" . }}-sdnrdb-init-job
51 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 command: ["/bin/bash"]
57 {{- if .Values.config.sdnr.mariadb.enabled }}
58 "{{ .Values.config.binDir }}/createSdnrDb.sh";
60 sleep 90; "{{ .Values.config.binDir }}/startODL.sh"
62 - name: SDNC_AAF_ENABLED
65 value: "{{.Values.config.sdncHome}}"
67 value: "{{.Values.config.etcDir}}"
69 value: "{{.Values.config.binDir}}"
70 ## start sdnrdb parameter
73 {{- if .Values.config.sdnr.mariadb.enabled }}
77 value: {{ include "common.mariadbService" . }}
78 - name: MYSQL_ROOT_PASSWORD
79 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
81 value: "jdbc:mysql://{{ include "common.mariadbService" . }}:3306/{{ .Values.config.sdnr.mariadb.databaseName }}"
82 - name: SDNRDBDATABASE
83 value: "{{ .Values.config.sdnr.mariadb.databaseName }}"
84 - name: SDNRDBUSERNAME
85 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "login") | indent 12 }}
86 - name: SDNRDBPASSWORD
87 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "password") | indent 12 }}
90 value: "http://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
91 - name: SDNRDBPARAMETER
94 {{- if .Values.config.sdnr.mariadb.enabled }}
96 - mountPath: {{ .Values.config.binDir }}/createSdnrDb.sh
98 subPath: createSdnrDb.sh
100 resources: {{ include "common.resources" . | nindent 10 }}
101 {{- if include "common.onServiceMesh" . }}
102 - name: sdnrdb-service-mesh-wait-for-job-container
103 image: {{ include "repositoryGenerator.image.quitQuit" . }}
104 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
110 echo "waiting 30s for istio side cars to be up"; sleep 30s;
111 /app/ready.py --service-mesh-check sdnc-sdnrdb-init-job -t 45;
117 fieldPath: metadata.namespace
119 {{- if .Values.nodeSelector }}
120 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
122 {{- if .Values.affinity }}
123 affinity: {{ toYaml .Values.affinity | nindent 10 }}
125 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
130 - name: docker-entrypoint-initdb-d
134 name: {{ include "common.fullname" . }}-bin
138 name: {{ include "common.fullname" . }}-properties
142 - name: "{{ include "common.namespace" . }}-docker-registry-key"