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
35 # if previous configuration exists put back original template file
36 for file in ../$2/*.yaml; do
37 if [ -e "$file-template" ]; then
38 mv "$file-template" "${file%}"
42 # replace the default 'onap' namespace qualification of K8s hostnames within
44 # note: this will create a '-template' file within the component's directory
45 # this is not ideal and should be addressed (along with the replacement
46 # of sed commands for configuration) by the future configuration
47 # user stories (ie. OOM-51 to OOM-53)
48 find ../$2 -type f -exec sed -i -template "s/onap-/$1-/g" {} \;
50 # replace the default '/dockerdata-nfs/onapdemo' volume mount paths
51 find ../$2 -iname "*.yaml" -type f -exec sed -i -e 's/dockerdata-nfs\/[a-zA-Z0-9\\-]*\//dockerdata-nfs\/'"$1"'\//g' {} \;
65 while getopts ":n:u:s:i:a:du:dp:" PARAM; do
82 if [[ -z $APP ]]; then
100 if [[ -z $NS ]]; then
105 if [[ ! -z "$APP" ]]; then
109 if [[ "$INCL_SVC" == true ]]; 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))
119 printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n"
123 printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n"
125 for i in ${ONAP_APPS[@]}; do
126 printf "\nCreating namespace **********\n"
127 create_namespace $NS $i
129 printf "\nCreating registry secret **********\n"
130 create_registry_key $NS $i $ONAP_DOCKER_REGISTRY_KEY $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
132 if [[ "$INCL_SVC" == true ]]; then
133 printf "\nCreating service **********\n"
134 create_service $NS $i $start $end
140 printf "\n\n********** Creating deployments for ${ONAP_APPS[*]} ********** \n"
141 for i in ${ONAP_APPS[@]}; do
143 /bin/bash $i.sh $NS $i 'create'
146 printf "\n**** Done ****\n"