Merge "SDNC using shared mariadb-galera cluster"
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Wed, 17 Apr 2019 12:21:27 +0000 (12:21 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 17 Apr 2019 12:21:27 +0000 (12:21 +0000)
1  2 
kubernetes/sdnc/charts/sdnc-portal/values.yaml
kubernetes/sdnc/resources/config/bin/startODL.sh

@@@ -18,7 -18,7 +18,7 @@@
  global:
    nodePortPrefix: 302
    readinessRepository: oomk8s
-   readinessImage: readiness-check:2.0.0
+   readinessImage: readiness-check:2.0.2
    loggingRepository: docker.elastic.co
    loggingImage: beats/filebeat:5.5.0
  
@@@ -35,15 -35,20 +35,20 @@@ debugEnabled: fals
  
  # application configuration
  config:
-   mysqlChartName: sdnc-db
-   dbRootPassword: openECOMP1.0
+   dbRootPassword: secretpassword
    dbSdnctlPassword: gamma
    sdncChartName: sdnc
    configDir: /opt/onap/sdnc/data/properties
+   storesDir: /opt/onap/sdnc/data/stores
    odlPassword: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+   keystorePwd: ?w5&!M;8v1XF;:Xd;g*%S$IY
+   mariadbGalera:
+     chartName: mariadb-galera
+     serviceName: mariadb-galera
+     internalPort: 3306
  
  # default number of instances
 -replicaCount: 1
 +replicaCount: 0
  
  nodeSelector: {}
  
@@@ -72,11 -77,6 +77,6 @@@ service
  ingress:
    enabled: false
  
- mysql:
-   service:
-     name: sdnc-dbhost
-     internalPort: 3306
  #Resource limit flavor -By default using small
  flavor: small
  #segregation for different environment (small and large)
  # ============LICENSE_END=========================================================
  ###
  
 +# Append features to karaf boot feature configuration
 +# $1 additional feature to be added
 +# $2 repositories to be added (optional)
 +function addToFeatureBoot() {
 +  CFG=$ODL_HOME/etc/org.apache.karaf.features.cfg
 +  ORIG=$CFG.orig
 +  if [ -n "$2" ] ; then
 +    echo "Add repository: $2"
 +    mv $CFG $ORIG
 +    cat $ORIG | sed -e "\|featuresRepositories|s|$|,$2|" > $CFG
 +  fi
 +  echo "Add boot feature: $1"
 +  mv $CFG $ORIG
 +  cat $ORIG | sed -e "\|featuresBoot *=|s|$|,$1|" > $CFG
 +}
 +
 +# Append features to karaf boot feature configuration
 +# $1 search pattern
 +# $2 replacement
 +function replaceFeatureBoot() {
 +  CFG=$ODL_HOME/etc/org.apache.karaf.features.cfg
 +  ORIG=$CFG.orig
 +  echo "Replace boot feature $1 with: $2"
 +  sed -i "/featuresBoot/ s/$1/$2/g" $CFG
 +}
 +
 +function install_sdnrwt_features() {
 +  addToFeatureBoot "$SDNRWT_BOOTFEATURES" $SDNRWT_REPOSITORY
 +}
 +
  function enable_odl_cluster(){
    if [ -z $SDNC_REPLICAS ]; then
       echo "SDNC_REPLICAS is not configured in Env field"
       exit
    fi
  
 +  #Be sure to remove feature odl-netconf-connector-all from list
 +  replaceFeatureBoot "odl-netconf-connector-all,"
 +
    echo "Installing Opendaylight cluster features"
 -  mv $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig
 -  cat $ODL_HOME/etc/org.apache.karaf.features.cfg.orig | sed -e "\|featuresBoot=config|s|$|,odl-mdsal-clustering,odl-jolokia|" > $ODL_HOME/etc/org.apache.karaf.features.cfg
 +  replaceFeatureBoot odl-netconf-topology odl-netconf-clustered-topology
 +  replaceFeatureBoot odl-mdsal-all odl-mdsal-all,odl-mdsal-clustering
 +  addToFeatureBoot odl-jolokia
    #${ODL_HOME}/bin/client feature:install odl-mdsal-clustering
    #${ODL_HOME}/bin/client feature:install odl-jolokia
 +  
  
    echo "Update cluster information statically"
    hm=$(hostname)
@@@ -119,17 -84,10 +119,17 @@@ SDNC_BIN=${SDNC_BIN:-/opt/onap/sdnc/bin
  CCSDK_HOME=${CCSDK_HOME:-/opt/onap/ccsdk}
  SLEEP_TIME=${SLEEP_TIME:-120}
  MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}}
- MYSQL_HOST=${MYSQL_HOST:-{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}}
+ MYSQL_HOST=${MYSQL_HOST:-{{.Values.config.dbServiceName}}.{{.Release.Namespace}}}
  ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false}
  GEO_ENABLED=${GEO_ENABLED:-false}
  DBINIT_DIR=${DBINIT_DIR:-/opt/opendaylight/current/daexim}
 +SDNRWT=${SDNRWT:-false}
 +SDNRWT_BOOTFEATURES=${SDNRWT_BOOTFEATURES:-sdnr-wt-feature-aggregator}
 +
 +echo "Settings:"
 +echo "  ENABLE_ODL_CLUSTER=$ENABLE_ODL_CLUSTER"
 +echo "  SDNC_REPLICAS=$SDNC_REPLICAS"
 +echo "  SDNRWT=$SDNRWT"
  
  #
  # Wait for database to init properly
@@@ -171,8 -129,6 +171,8 @@@ the
  
        if $ENABLE_ODL_CLUSTER ; then enable_odl_cluster ; fi
  
 +      if $SDNRWT ; then install_sdnrwt_features ; fi
 +
          echo "Installed at `date`" > ${SDNC_HOME}/.installed
  fi