3 . $(dirname "$0")/setenv.bash
10 -n [NAMESPACE] : Kubernetes namespace (required)
11 -v [VALUES] : HELM values filepath (usefull when deploying one component at a time)
12 -l [LOCATION] : Location of oom project
13 -i [INSTANCE] : ONAP deployment instance # (default: 1)
14 -a [APP] : Specify a specific ONAP component (default: all)
15 from the following choices:
16 sdc, aai ,mso, message-router, robot,
17 vid, sdnc, portal, policy, appc, multicloud
23 if [ $ret -ne 0 ]; then
24 printf "The command $1 returned with error code $ret \n" 1>&2
31 cmd=`echo kubectl create namespace $1-$2`
33 check_return_code $cmd
36 create_registry_key() {
37 cmd=`echo kubectl --namespace $1-$2 create secret docker-registry $3 --docker-server=$4 --docker-username=$5 --docker-password=$6 --docker-email=$7`
39 check_return_code $cmd
43 HELM_VALUES_ADDITION=""
44 if [[ ! -z $HELM_VALUES_FILEPATH ]]; then
45 HELM_VALUES_ADDITION="--values=$HELM_VALUES_FILEPATH"
47 cmd=`echo helm install $LOCATION/$2/ --name $1-$2 --namespace $1 --set nsPrefix=$1,nodePortPrefix=$3 ${HELM_VALUES_ADDITION}`
49 check_return_code $cmd
54 HELM_VALUES_FILEPATH=""
63 while getopts ":n:u:s:i:a:du:dp:l:v:" PARAM; do
73 HELM_VALUES_FILEPATH=${OPTARG}
83 if [[ -z $APP ]]; then
101 if [[ -z $NS ]]; then
106 if [[ ! -z "$APP" ]]; then
111 if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then
112 printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n"
113 printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n"
117 start=$((300+2*INSTANCE))
120 printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n"
123 printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n"
126 printf "\n\n********** Creating deployments for ${HELM_APPS[*]} ********** \n"
128 for i in ${HELM_APPS[@]}; do
129 printf "\nCreating namespace **********\n"
130 create_namespace $NS $i
132 printf "\nCreating registry secret **********\n"
133 create_registry_key $NS $i ${NS}-docker-registry-key $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
135 printf "\nCreating deployments and services **********\n"
136 create_onap_helm $NS $i $start
141 printf "\n**** Done ****\n"