aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/oneclick
diff options
context:
space:
mode:
authorkerenj <keren.joseph@amdocs.com>2017-08-24 13:54:21 +0000
committerkerenj <keren.joseph@amdocs.com>2017-08-24 13:54:35 +0000
commit80102849bc4a8920f84fb4798d19d28e2a91da1b (patch)
tree0a1ca19a049ac53dfe5591262ff9a4617e3a6eae /kubernetes/oneclick
parentfdc176253250ac0100a15b0d08fe752e2b5cb701 (diff)
sdc K8S-Helm Parameterization
changed sdc k8s deployment to support helm parameterization. updated create/delete for helm only Issue-ID: OOM-52 Change-Id: Ic7fb17fcf5be5813b0a0c54299cdf0d0417e8a76 Signed-off-by: kerenj <keren.joseph@amdocs.com>
Diffstat (limited to 'kubernetes/oneclick')
-rwxr-xr-xkubernetes/oneclick/createAll.bash52
-rwxr-xr-xkubernetes/oneclick/deleteAll.bash22
-rw-r--r--kubernetes/oneclick/setenv.bash3
3 files changed, 12 insertions, 65 deletions
diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash
index 7e2969760a..95dd809027 100755
--- a/kubernetes/oneclick/createAll.bash
+++ b/kubernetes/oneclick/createAll.bash
@@ -8,7 +8,6 @@ usage() {
Usage: $0 [PARAMs]
-u : Display usage
-n [NAMESPACE] : Kubernetes namespace (required)
--s false : Exclude services (default: true)
-i [INSTANCE] : ONAP deployment instance # (default: 1)
-a [APP] : Specify a specific ONAP component (default: all)
from the following choices:
@@ -25,14 +24,6 @@ create_registry_key() {
kubectl --namespace $1-$2 create secret docker-registry $3 --docker-server=$4 --docker-username=$5 --docker-password=$6 --docker-email=$7
}
-create_service() {
- sed -i-- 's/nodePort: [0-9]\{2\}[02468]\{1\}/nodePort: '"$3"'/g' ../$2/all-services.yaml
- sed -i-- 's/nodePort: [0-9]\{2\}[13579]\{1\}/nodePort: '"$4"'/g' ../$2/all-services.yaml
- kubectl --namespace $1-$2 create -f ../$2/all-services.yaml
- mv ../$2/all-services.yaml-- ../$2/all-services.yaml
-}
-
-
create_onap_helm() {
helm install ../$2/ --name $2
}
@@ -84,9 +75,6 @@ while getopts ":n:u:s:i:a:du:dp:" PARAM; do
n)
NS=${OPTARG}
;;
- s)
- INCL_SVC=${OPTARG}
- ;;
i)
INSTANCE=${OPTARG}
;;
@@ -116,46 +104,26 @@ if [[ -z $NS ]]; then
fi
if [[ ! -z "$APP" ]]; then
- ONAP_APPS=($APP)
+ HELM_APPS=($APP)
fi
-if [[ "$INCL_SVC" == true ]]; then
-
- if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then
- printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n"
- printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n"
- exit 1
- fi
-
- start=$((300+2*INSTANCE))
- end=$((start+1))
- printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n"
+if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then
+ printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n"
+ printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n"
+ exit 1
fi
-printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n"
+start=$((300+2*INSTANCE))
+end=$((start+1))
-for i in ${ONAP_APPS[@]}; do
- printf "\nCreating namespace **********\n"
- create_namespace $NS $i
+printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n"
- printf "\nCreating registry secret **********\n"
- create_registry_key $NS $i $ONAP_DOCKER_REGISTRY_KEY $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
- if [[ "$INCL_SVC" == true ]]; then
- printf "\nCreating service **********\n"
- create_service $NS $i $start $end
- fi
+printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n"
- printf "\n"
-done
-printf "\n\n********** Creating deployments for ${ONAP_APPS[*]} ********** \n"
-for i in ${ONAP_APPS[@]}; do
- _FILES_PATH=$(echo ../$i)
- configure_app $NS $i $_FILES_PATH $start $end
- /bin/bash $i.sh $NS $i 'create'
-done
+printf "\n\n********** Creating deployments for ${HELM_APPS[*]} ********** \n"
for i in ${HELM_APPS[@]}; do
printf "\nCreating namespace **********\n"
diff --git a/kubernetes/oneclick/deleteAll.bash b/kubernetes/oneclick/deleteAll.bash
index ad7f060d12..dfa75b59c4 100755
--- a/kubernetes/oneclick/deleteAll.bash
+++ b/kubernetes/oneclick/deleteAll.bash
@@ -16,10 +16,6 @@ delete_registry_key() {
kubectl --namespace $1-$2 delete secret onap-docker-registry-key
}
-delete_service() {
- kubectl --namespace $1-$2 delete -f ../$2/all-services.yaml
-}
-
delete_app_helm() {
helm delete $1 --purge
}
@@ -29,7 +25,6 @@ usage() {
Usage: $0 [PARAMs]
-u : Display usage
-n [NAMESPACE] : Kubernetes namespace (required)
--s true : Include services (default: false)
-a [APP] : Specify a specific ONAP component (default: all)
from the following choices:
sdc, aai ,mso, message-router, robot,
@@ -51,9 +46,6 @@ while getopts ":n:u:s:a:" PARAM; do
n)
NS=${OPTARG}
;;
- s)
- INCL_SVC=${OPTARG}
- ;;
a)
APP=${OPTARG}
if [[ -z $APP ]]; then
@@ -74,23 +66,11 @@ if [[ -z $NS ]]; then
fi
if [[ ! -z "$APP" ]]; then
- ONAP_APPS=($APP)
+ HELM_APPS=($APP)
fi
printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n"
-for i in ${ONAP_APPS[@]}; do
-
- # delete the deployments
- /bin/bash $i.sh $NS $i 'delete'
-
- if [[ "$INCL_SVC" == true ]]; then
- printf "\nDeleting services **********\n"
- delete_service $NS $i
- delete_namespace $NS $i
- fi
-
-done
for i in ${HELM_APPS[@]}; do
diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash
index 996a8755b5..c7f3aba024 100644
--- a/kubernetes/oneclick/setenv.bash
+++ b/kubernetes/oneclick/setenv.bash
@@ -1,7 +1,6 @@
#!/bin/bash
-HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'appc' 'aai')
-ONAP_APPS=('sdc')
+HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'appc' 'aai' 'sdc')
ONAP_DOCKER_REGISTRY_KEY=${ONAP_DOCKER_REGISTRY_KEY:-onap-docker-registry-key}
ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001}
ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker}