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.mariadbAppName" . }}
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 }}
57 - name: {{ include "common.name" . }}-sdnrdb-init-job
58 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
59 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 command: ["/bin/bash"]
64 {{- if .Values.config.sdnr.mariadb.enabled }}
65 "{{ .Values.config.binDir }}/createSdnrDb.sh";
67 sleep 90; "{{ .Values.config.binDir }}/startODL.sh"
69 - name: SDNC_AAF_ENABLED
72 value: "{{.Values.config.sdncHome}}"
74 value: "{{.Values.config.etcDir}}"
76 value: "{{.Values.config.binDir}}"
77 ## start sdnrdb parameter
80 {{- if .Values.config.sdnr.mariadb.enabled }}
84 value: {{ include "common.mariadbService" . }}
85 - name: MYSQL_ROOT_PASSWORD
86 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
88 value: "jdbc:mysql://{{ include "common.mariadbService" . }}:3306/{{ .Values.config.sdnr.mariadb.databaseName }}"
89 - name: SDNRDBDATABASE
90 value: "{{ .Values.config.sdnr.mariadb.databaseName }}"
91 - name: SDNRDBUSERNAME
92 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "login") | indent 12 }}
93 - name: SDNRDBPASSWORD
94 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "password") | indent 12 }}
97 value: "http://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
98 - name: SDNRDBPARAMETER
101 {{- if .Values.config.sdnr.mariadb.enabled }}
103 - mountPath: {{ .Values.config.binDir }}/createSdnrDb.sh
105 subPath: createSdnrDb.sh
107 resources: {{ include "common.resources" . | nindent 10 }}
108 {{- if include "common.onServiceMesh" . }}
109 - name: sdnrdb-service-mesh-wait-for-job-container
110 image: {{ include "repositoryGenerator.image.quitQuit" . }}
111 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
117 echo "waiting 30s for istio side cars to be up"; sleep 30s;
118 /app/ready.py --service-mesh-check sdnc-sdnrdb-init-job -t 45;
124 fieldPath: metadata.namespace
126 {{- if .Values.nodeSelector }}
127 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
129 {{- if .Values.affinity }}
130 affinity: {{ toYaml .Values.affinity | nindent 10 }}
132 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
137 - name: docker-entrypoint-initdb-d
141 name: {{ include "common.fullname" . }}-bin
145 name: {{ include "common.fullname" . }}-properties
149 - name: "{{ include "common.namespace" . }}-docker-registry-key"