Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add parameter for autoCreateOnapConfig script

...

#PurposeCommand and Examples
1Get the shared templates code git fetch command

Go to gerrit change 25467

Click Download downward arrow, and click the click board in the same line as Checkout to get the git commands (which includes the git fetch and checkout commands).

Expand
titleAn example of the git commands with patch set 19

git fetch https://gerrit.onap.org/r/oom refs/changes/67/25467/19 && git checkout FETCH_HEAD

2Fetch the shared template to the oom directory on the Kubernetes node VM

cd {$OOM}

run the git commands got from step 1

3Link the new startODL.sh
Info

Skip this change if you have skipped the get new startODL.sh script section


vi kubernetes/sdnc/templates/sdnc-statefulset.yaml

do the following changes:

PurposeChanges


mount point for new startODL.sh script

FieldAdded Value

.spec.template.spec.containers.volumeMounts

(of container sdnc-controller-container)

- mountPath: /opt/onap/sdnc/bin/startODL.sh
name: sdnc-startodl

 .spec.template.spec.volumes

- name: sdnc-startodl
hostPath:
path: /dockerdata-nfs/cluster/script/startODL.sh

3Link the ODL deploy directory
Info

If you are not going to use the test bundle to test out SDN-C cluster and load balancing, you can skip this step.

ODL automatically install bundles/pacakges under its deploy directory, this mount point provides capability to drop a bundle/package in the Kubernetes node at /dockerdata-nfs/cluster/deploy directory and it will automativally be installed in the sdnc pods.


vi kubernetes/sdnc/templates/sdnc-statefulset.yaml

do the following changes:

PurposeChanges

mount point for ODL deploy directory

FieldAdded Value

.spec.template.spec.containers.volumeMounts

(of container sdnc-controller-container)

- mountPath: /opt/opendaylight/current/deploy
name: sdnc-deploy

.spec.template.spec.volumes

- name: sdnc-deploy
hostPath:
path: /dockerdata-nfs/cluster/deploy


5Enable cluster configuration

vi kubernetes/sdnc/values.yaml

change the following fields with the new value:

fieldnew valueold value
enableODLClustertruefalse
numberOfODLReplicas31
numberOfDbReplicas21

...

Code Block
languagebash
titleautoCreateOnapConfig
linenumberstrue
collapsetrue
########################################################################################
# This script wraps {$OOM}/kubernetes/config/createConfig.sh script                    #
# and will only terminated when the ONAP configuration is Completed                    #
#                                                                                      #
# Before using it, do the following to prepare the bash file:                          #
#   1, cd {$OOM}/kumbernetes/oneclick/tools                                            #
#   2, vi autoCreateOnapConfig.bash                                                    #
#   3, paste the full content here to autoCreateOnapConfig.bash file and save the file #
#   4, chmod 777 autoCleanOnapConfig.bash                                              #
#                                                                                      #
# To run it, just enter the following command:                                         #
#    ./autoCreateOnapConfig.bash <namespace, default is "onap">                                                       #
########################################################################################
#!/bin/bash

NS=$1
if [[ -z $NS ]]
then
  echo "Namespace is not specified, use onap namespace."
  NS="onap"
fi


echo "Create $NS config under config directory..."
cd ../../config
./createConfig.sh -n $NS
cd -


echo "...done : kubectl get namespace
-----------------------------------------------
>>>>>>>>>>>>>> k8s namespace"
kubectl get namespace


echo "
-----------------------------------------------
>>>>>>>>>>>>>> helm : helm ls --all"
helm ls --all


echo "
-----------------------------------------------
>>>>>>>>>>>>>> pod : kubectl get pods -n $NS -a"
kubectl get pods -n $NS -a


while true
do
  echo "wait for $NS config pod reach to Completed STATUS"
  sleep 5
  echo "-----------------------------------------------"
  kubectl get pods -n $NS -a

  status=`kubectl get pods -n $NS -a |grep config |xargs echo | cut -d' ' -f3`

  if [ "$status" = "Completed" ]
  then
    echo "$NS config is Completed!!!"
    break
  fi

  if [ "$status" = "Error" ]
  then
    echo "$NS config is failed with Error!!!
POD logs are:"
    kubectl logs config -n $NS -f
    break
  fi
done

...