Helm charts for supporting clustering in ODL
[integration/packaging.git] / helm / opendaylight / templates / configmap.yaml
index 3d26566f542a826791186426a0d1c83f7959803e..5925460760aa36b9273b0fb1752f597234a06160 100644 (file)
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ include "opendaylight.fullname" . }}
+  name: {{ include "opendaylight.fullname" . }}-scripts
 data:
-  startodl.sh: |
-    #!/bin/bash
-    mountpath="{{ .Values.persistence.mountPath }}"
-    BASEDIR="{{ .Values.config.odl_basedir }}"
-    odl_prefix="/opt/opendaylight"
-
-    if [[ ! -d "$mountpath/snapshots" ]];then
-      mkdir -p $mountpath/snapshots
-    fi
-
-    if [[ ! -d "$mountpath/data" ]];then
-      mkdir -p $mountpath/data
-    fi
-
-    if [[ ! -d "$mountpath/segmented-journal" ]];then
-      mkdir -p $mountpath/segmented-journal
-    fi
-
-    if [[ ! -d "$mountpath/daexim" ]];then
-      mkdir -p $mountpath/daexim
-    fi
-
-    if [[ ! -L "$odl_prefix/snapshots" ]];then
-      rm -rf $odl_prefix/snapshots && ln -s $mountpath/snapshots $odl_prefix/snapshots
-    fi
-
-    if [[ ! -L "$odl_prefix/data" ]];then
-      rm -rf $odl_prefix/data && ln -s $mountpath/data $odl_prefix/data
-    fi
-
-    if [[ ! -L "$odl_prefix/segmented-journal" ]];then
-      rm -rf $odl_prefix/segmented-journal && ln -s $mountpath/segmented-journal $odl_prefix/segmented-journal
-    fi
-
-    if [[ ! -L "$odl_prefix/daexim" ]];then
-      rm -rf $odl_prefix/daexim && ln -s $mountpath/daexim $odl_prefix/daexim
-    fi
-
-    sed -i "s/\(featuresBoot= \|featuresBoot = \)/featuresBoot = ${FEATURES},/g" ${BASEDIR}/etc/org.apache.karaf.features.cfg
-    cat ${BASEDIR}/etc/org.apache.karaf.features.cfg
-    ${BASEDIR}/bin/karaf run
+{{ tpl (.Files.Glob "resources/bin/*").AsConfig . | indent 2 }}
+---
+{{- if .Values.config.isClusterDeployment }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "opendaylight.fullname" . }}-conf
+data:
+{{ tpl (.Files.Glob "resources/conf/*").AsConfig . | indent 2 }}
+{{- end }}
\ No newline at end of file