3 . $(dirname "$0")/setenv.bash
10 -n [NAMESPACE] : Kubernetes namespace (required)
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 helm install ../$2/ --name $2
32 # if previous configuration exists put back original template file
33 for file in $3/*.yaml; do
34 if [ -e "$file-template" ]; then
35 mv "$file-template" "${file%}"
39 if [ -e "$2/Chart.yaml" ]; then
40 sed -i-- 's/nodePort: [0-9]\{2\}[02468]\{1\}/nodePort: '"$4"'/g' $3/all-services.yaml
41 sed -i-- 's/nodePort: [0-9]\{2\}[13579]\{1\}/nodePort: '"$5"'/g' $3/all-services.yaml
42 sed -i "s/onap-/$1-/g" ../$2/values.yaml
46 # replace the default 'onap' namespace qualification of K8s hostnames within
48 # note: this will create a '-template' file within the component's directory
49 # this is not ideal and should be addressed (along with the replacement
50 # of sed commands for configuration) by the future configuration
51 # user stories (ie. OOM-51 to OOM-53)
52 find $3 -type f -exec sed -i -- "s/onap-/$1-/g" {} \;
54 # replace the default '/dockerdata-nfs/onapdemo' volume mount paths
55 find $3 -iname "*.yaml" -type f -exec sed -i -e 's/dockerdata-nfs\/[a-zA-Z0-9\\-]*\//dockerdata-nfs\/'"$1"'\//g' {} \;
69 while getopts ":n:u:s:i:a:du:dp:" PARAM; do
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 $ONAP_DOCKER_REGISTRY_KEY $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
135 printf "\nCreating deployments and services **********\n"
136 _FILES_PATH=$(echo ../$i/templates)
137 configure_app $NS $i $_FILES_PATH $start $end
138 create_onap_helm $NS $i
143 printf "\n**** Done ****\n"