diff options
author | jmac <james.macnider@amdocs.com> | 2018-04-16 19:54:54 +0000 |
---|---|---|
committer | jmac <james.macnider@amdocs.com> | 2018-04-16 19:55:01 +0000 |
commit | c21cb7d164e4febd55edee5b8d5a2b6c82889568 (patch) | |
tree | e6a28b40d8235fca5d2a8204327eac47a2f1dd45 /kubernetes | |
parent | a6ee34ed3a655541a4cac72c15dc7a9ee57a0ccc (diff) |
Fix SDN-C bundles that don't come up properly
Change-Id: Ieccbd863e45bb68d76f4f1f066433276c9adf3cd
Signed-off-by: jmac <james.macnider@amdocs.com>
Issue-ID: OOM-945
Diffstat (limited to 'kubernetes')
-rw-r--r-- | kubernetes/onap/resources/environments/dev.yaml | 9 | ||||
-rw-r--r-- | kubernetes/onap/values.yaml | 9 | ||||
-rwxr-xr-x | kubernetes/sdnc/resources/config/bin/startODL.sh | 41 | ||||
-rw-r--r-- | kubernetes/sdnc/resources/config/conf/dblib.properties | 2 | ||||
-rw-r--r-- | kubernetes/sdnc/resources/config/conf/svclogic.properties | 2 | ||||
-rw-r--r-- | kubernetes/sdnc/templates/statefulset.yaml | 2 |
6 files changed, 53 insertions, 12 deletions
diff --git a/kubernetes/onap/resources/environments/dev.yaml b/kubernetes/onap/resources/environments/dev.yaml index 61a7546db0..a8dd5243ff 100644 --- a/kubernetes/onap/resources/environments/dev.yaml +++ b/kubernetes/onap/resources/environments/dev.yaml @@ -88,9 +88,18 @@ sdc: sdnc: enabled: false + replicaCount: 1 + + config: + enableClustering: false + dmaap-listener: config: dmaapPort: 3904 + + mysql: + disableNfsProvisioner: false + replicaCount: 1 so: enabled: true diff --git a/kubernetes/onap/values.yaml b/kubernetes/onap/values.yaml index f784eebe30..619e9409bf 100644 --- a/kubernetes/onap/values.yaml +++ b/kubernetes/onap/values.yaml @@ -89,9 +89,18 @@ sdc: sdnc: enabled: true + replicaCount: 1 + + config: + enableClustering: false + dmaap-listener: config: dmaapPort: 3904 + + mysql: + disableNfsProvisioner: false + replicaCount: 1 so: enabled: true diff --git a/kubernetes/sdnc/resources/config/bin/startODL.sh b/kubernetes/sdnc/resources/config/bin/startODL.sh index 0c41d3e3e0..aa5b6d1479 100755 --- a/kubernetes/sdnc/resources/config/bin/startODL.sh +++ b/kubernetes/sdnc/resources/config/bin/startODL.sh @@ -34,17 +34,38 @@ function enable_odl_cluster(){ hm=$(hostname) echo "Get current Hostname ${hm}" - node=($(echo ${hm} | sed 's/-[0-9]*$//g')) - node_index=($(echo ${hm} | awk -F"-" '{print $NF}')) - node_list="${node}-0.{{ .Values.service.name }}-cluster.{{.Release.Namespace}}"; + node=($(echo ${hm} | tr '-' '\n')) + node_name=${node[0]} + node_index=${node[1]} + + if [ -z $PEER_ODL_CLUSTER ]; then + echo "This is a local cluster" + node_list="${node_name}-0.{{.Values.service.name}}-cluster.{{.Release.Namespace}}"; + + for ((i=1;i<${SDNC_REPLICAS};i++)); + do + node_list="${node_list} ${node_name}-$i.{{.Values.service.name}}-cluster.{{.Release.Namespace}}" + done + /opt/opendaylight/current/bin/configure_cluster.sh $((node_index+1)) ${node_list} + else + echo "This is a Geo cluster" + + if $IS_PRIMARY_CLUSTER; then + PRIMARY_NODE=${MY_ODL_CLUSTER} + SECONDARY_NODE=${PEER_ODL_CLUSTER} + else + PRIMARY_NODE=${PEER_ODL_CLUSTER} + SECONDARY_NODE=${MY_ODL_CLUSTER} + member_offset=4 + fi + + node_list="${PRIMARY_NODE} ${SECONDARY_NODE}" + /opt/onap/sdnc/bin/configure_geo_cluster.sh $((node_index+member_offset)) ${node_list} + fi +} - for ((i=1;i<${SDNC_REPLICAS};i++)); - do - node_list="${node_list} ${node}-$i.{{ .Values.service.name }}-cluster.{{.Release.Namespace}}" - done - /opt/opendaylight/current/bin/configure_cluster.sh $((node_index+1)) ${node_list} -} +# Install SDN-C platform components if not already installed and start container ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} @@ -53,6 +74,8 @@ SLEEP_TIME=${SLEEP_TIME:-120} MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}} ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false} MYSQL_HOST=${MYSQL_HOST:-{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}} +IS_PRIMARY_CLUSTER=${IS_PRIMARY_CLUSTER:-false} +MY_ODL_CLUSTER=${MY_ODL_CLUSTER:-127.0.0.1} # # Wait for database to init properly diff --git a/kubernetes/sdnc/resources/config/conf/dblib.properties b/kubernetes/sdnc/resources/config/conf/dblib.properties index 9faf9e2482..499834e0e2 100644 --- a/kubernetes/sdnc/resources/config/conf/dblib.properties +++ b/kubernetes/sdnc/resources/config/conf/dblib.properties @@ -23,7 +23,7 @@ org.onap.ccsdk.sli.dbtype=jdbc org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01 -org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}:{{.Values.mysql.service.internalPort}}/sdnctl +org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.mysql.service.name}}.{{.Release.Namespace}}:{{.Values.mysql.service.internalPort}}/sdnctl org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver org.onap.ccsdk.sli.jdbc.database=sdnctl org.onap.ccsdk.sli.jdbc.user=sdnctl diff --git a/kubernetes/sdnc/resources/config/conf/svclogic.properties b/kubernetes/sdnc/resources/config/conf/svclogic.properties index dbbbb92b41..99f6cf84b7 100644 --- a/kubernetes/sdnc/resources/config/conf/svclogic.properties +++ b/kubernetes/sdnc/resources/config/conf/svclogic.properties @@ -20,7 +20,7 @@ ### org.onap.ccsdk.sli.dbtype = jdbc -org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}:{{.Values.mysql.service.internalPort}}/sdnctl +org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://{{.Values.mysql.service.name}}.{{.Release.Namespace}}:{{.Values.mysql.service.internalPort}}/sdnctl org.onap.ccsdk.sli.jdbc.database = sdnctl org.onap.ccsdk.sli.jdbc.user = sdnctl org.onap.ccsdk.sli.jdbc.password = gamma diff --git a/kubernetes/sdnc/templates/statefulset.yaml b/kubernetes/sdnc/templates/statefulset.yaml index fd4f81bd8f..8b4055e1df 100644 --- a/kubernetes/sdnc/templates/statefulset.yaml +++ b/kubernetes/sdnc/templates/statefulset.yaml @@ -76,7 +76,7 @@ spec: - name: SDNC_REPLICAS value: "{{ .Values.replicaCount }}" - name: MYSQL_HOST - value: "{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}" + value: "{{.Values.mysql.service.name}}.{{.Release.Namespace}}" volumeMounts: - mountPath: /etc/localtime name: localtime |