summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mariadb-init/templates/configmap.yaml
diff options
context:
space:
mode:
authorRPMishra <rpmishra@aarnanetworks.com>2020-10-07 12:09:01 +0530
committerKrzysztof Opasiak <k.opasiak@samsung.com>2020-11-18 08:08:36 +0000
commite4ee7f1be369215e609930f5a885bd04cbe4534d (patch)
treeed60bbc662d22e848654dfe115d6100d7c4a33b9 /kubernetes/common/mariadb-init/templates/configmap.yaml
parentc25f743b482e180c6b6d0798b5f99c9708130f9b (diff)
[COMMON/VID] Modified VID to use Shared DB.
This change modifies VID to use the shared DB instance of mariadb. In addition, we create a mechanism in mariadb-init to allow a shared DB user to run a script after the DB has been created. The script can be passed as a configMap (as is the case with VID) or it can be a standalone script that is passed as a string. Issue-ID: OOM-1226 Change-Id: Ie51823338562a6fbe7472025d62cd4dba688168d Signed-off-by: RPMishra <rpmishra@aarnanetworks.com> Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Diffstat (limited to 'kubernetes/common/mariadb-init/templates/configmap.yaml')
-rw-r--r--kubernetes/common/mariadb-init/templates/configmap.yaml16
1 files changed, 16 insertions, 0 deletions
diff --git a/kubernetes/common/mariadb-init/templates/configmap.yaml b/kubernetes/common/mariadb-init/templates/configmap.yaml
index d021d60b8d..6708efdb60 100644
--- a/kubernetes/common/mariadb-init/templates/configmap.yaml
+++ b/kubernetes/common/mariadb-init/templates/configmap.yaml
@@ -27,3 +27,19 @@ metadata:
heritage: {{ .Release.Service }}
data:
{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }}
+---
+{{ if .Values.dbScript }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ include "common.fullname" . }}-dbscript
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.name" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ include "common.release" . }}
+ heritage: {{ .Release.Service }}
+data:
+ db_cmd.sh: |
+ {{ tpl .Values.dbScript . | indent 4 }}
+{{- end }}