3 . $(dirname "$0")/setenv.bash
9 -n [NAMESPACE] : Kubernetes namespace (required)
10 -s false : Exclude services (default: true)
11 -i [INSTANCE] : ONAP deployment instance # (default: 1)
12 -a [APP] : Specify a specific ONAP component (default: all)
13 from the following choices:
14 sdc, aai ,mso, message-router, robot,
15 vid, sdnc, portal, policy, appc
20 kubectl create namespace $1-$2
23 create_registry_key() {
24 kubectl --namespace $1-$2 create secret docker-registry $3 --docker-server=$4 --docker-username=$5 --docker-password=$6 --docker-email=$7
28 sed -i -- 's/nodePort: [0-9]\{2\}[02468]\{1\}/nodePort: '"$3"'/g' ../$2/all-services.yaml
29 sed -i -- 's/nodePort: [0-9]\{2\}[13579]\{1\}/nodePort: '"$4"'/g' ../$2/all-services.yaml
30 kubectl --namespace $1-$2 create -f ../$2/all-services.yaml
31 mv ../$2/all-services.yaml-- ../$2/all-services.yaml
43 while getopts ":n:u:s:i:a:du:dp:" PARAM; do
60 if [[ -z $APP ]]; then
83 if [[ ! -z "$APP" ]]; then
87 if [[ "$INCL_SVC" == true ]]; then
89 if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then
90 printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n"
91 printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n"
95 start=$((300+2*INSTANCE))
97 printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n"
101 printf "\n********** Creating up ONAP: ${ONAP_APPS[*]}\n"
103 for i in ${ONAP_APPS[@]}; do
104 printf "\nCreating namespaces **********\n"
105 create_namespace $NS $i
107 if [[ "$INCL_SVC" == true ]]; then
108 printf "\nCreating services **********\n"
109 create_service $NS $i $start $end
115 printf "\n\n********** Creating deployments for ${ONAP_APPS[*]} ********** \n"
116 for i in ${ONAP_APPS[@]}; do
117 create_registry_key $NS $i $ONAP_DOCKER_REGISTRY_KEY $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
118 /bin/bash $i.sh $NS $i 'create'
121 printf "\n**** Done ****\n"