aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/sdnc/templates
diff options
context:
space:
mode:
authorAndreas Geissler <andreas-geissler@telekom.de>2023-09-21 14:54:52 +0000
committerGerrit Code Review <gerrit@onap.org>2023-09-21 14:54:52 +0000
commitb78a6142f4714995c58825ea18d59f606c4febb4 (patch)
treefcb647320e17cd2b6396e44366c1a15ae76ee077 /kubernetes/sdnc/templates
parent1ee2b57a550ace45691704f861dd71d100639818 (diff)
parent4e1f84c35b578d9c86898d324041c572305ff125 (diff)
Merge "[SDNC] Change SDNR DB from elasticsearch to maria DB"
Diffstat (limited to 'kubernetes/sdnc/templates')
-rwxr-xr-xkubernetes/sdnc/templates/sdnrdb-init-job.yaml31
-rw-r--r--kubernetes/sdnc/templates/statefulset.yaml19
2 files changed, 50 insertions, 0 deletions
diff --git a/kubernetes/sdnc/templates/sdnrdb-init-job.yaml b/kubernetes/sdnc/templates/sdnrdb-init-job.yaml
index 6c6e33a951..4b2f773f06 100755
--- a/kubernetes/sdnc/templates/sdnrdb-init-job.yaml
+++ b/kubernetes/sdnc/templates/sdnrdb-init-job.yaml
@@ -27,12 +27,17 @@ spec:
command:
- /app/ready.py
args:
+ {{- if .Values.config.sdnr.mariadb.enabled }}
+ - --container-name
+ - {{ include "common.mariadbService" . }}
+ {{- else -}}
- --container-name
- {{.Values.elasticsearch.nameOverride}}-elasticsearch
- --container-name
- {{.Values.elasticsearch.nameOverride}}-nginx
- --container-name
- {{.Values.elasticsearch.nameOverride}}-master
+ {{- end }}
env:
- name: NAMESPACE
valueFrom:
@@ -49,6 +54,9 @@ spec:
args:
- -c
- |
+ {{- if .Values.config.sdnr.mariadb.enabled }}
+ "{{ .Values.config.binDir }}/createSdnrDb.sh";
+ {{- end -}}
sleep 90; "{{ .Values.config.binDir }}/startODL.sh"
env:
- name: SDNC_AAF_ENABLED
@@ -62,10 +70,33 @@ spec:
## start sdnrdb parameter
- name: SDNRINIT
value: "true"
+ {{- if .Values.config.sdnr.mariadb.enabled }}
+ - name: SDNRDBTYPE
+ value: MARIADB
+ - name: MYSQL_HOST
+ value: {{ include "common.mariadbService" . }}
+ - name: MYSQL_ROOT_PASSWORD
+ {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
+ - name: SDNRDBURL
+ value: "jdbc:mysql://{{ include "common.mariadbService" . }}:3306/{{ .Values.config.sdnr.mariadb.databaseName }}"
+ - name: SDNRDBDATABASE
+ value: "{{ .Values.config.sdnr.mariadb.databaseName }}"
+ - name: SDNRDBUSERNAME
+ {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "login") | indent 12 }}
+ - name: SDNRDBPASSWORD
+ {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "password") | indent 12 }}
+ {{- else -}}
- name: SDNRDBURL
value: "http://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
- name: SDNRDBPARAMETER
value: "-k"
+ {{- end }}
+ {{- if .Values.config.sdnr.mariadb.enabled }}
+ volumeMounts:
+ - mountPath: {{ .Values.config.binDir }}/createSdnrDb.sh
+ name: bin
+ subPath: createSdnrDb.sh
+ {{- end }}
resources: {{ include "common.resources" . | nindent 10 }}
{{- if include "common.onServiceMesh" . }}
- name: sdnrdb-service-mesh-wait-for-job-container
diff --git a/kubernetes/sdnc/templates/statefulset.yaml b/kubernetes/sdnc/templates/statefulset.yaml
index b714775157..20f82e0d74 100644
--- a/kubernetes/sdnc/templates/statefulset.yaml
+++ b/kubernetes/sdnc/templates/statefulset.yaml
@@ -296,12 +296,31 @@ spec:
{{- end }}
- name: SDNRONLY
value: "{{ .Values.config.sdnr.sdnronly | default "false" }}"
+ {{- if .Values.config.sdnr.mariadb.enabled }}
+ - name: SDNRCONTROLLERID
+ value: {{ uuidv4 }}
+ - name: SDNRDBTYPE
+ value: MARIADB
+ - name: SDNRDBURL
+ value: "jdbc:mysql://{{ include "common.mariadbService" . }}:3306/{{ .Values.config.sdnr.mariadb.databaseName}}"
+ - name: SDNR_DB_DATABASE
+ value: {{ .Values.config.sdnr.mariadb.databaseName }}
+ - name: SDNRDBUSERNAME
+ {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "login") | indent 12 }}
+ - name: SDNRDBPASSWORD
+ {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "password") | indent 12 }}
+ - name: SDNR_ASYNC_HANDLING
+ value: {{ .Values.config.sdnr.mariadb.asyncHandling | default "false" | quote }}
+ - name: SDNR_ASYNC_POOLSIZE
+ value: {{ .Values.config.sdnr.mariadb.asyncPoolSize | default 200 | quote }}
+ {{- else -}}
- name: SDNRDBURL
value: "http://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
{{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
- name: SDNRDBTRUSTALLCERTS
value: "true"
{{- end }}
+ {{- end }}
{{- if .Values.global.cmpv2Enabled }}
- name: ODL_CERT_DIR
value: {{ (mustFirst (.Values.certificates)).mountPath }}