diff options
author | Mandeep Khinda <Mandeep.Khinda@amdocs.com> | 2017-06-24 11:49:37 -0400 |
---|---|---|
committer | Mandeep Khinda <Mandeep.Khinda@amdocs.com> | 2017-06-24 11:49:37 -0400 |
commit | d6ea987caed84a9f36030a5a1516df7c6186362d (patch) | |
tree | 265dda9cfb43a78542e4b2ccac382a8a5583bc56 /kubernetes/oneclick | |
parent | 43d96ac929c93d0aa2a55d860e0425a39118f7b4 (diff) |
onap on kubernetes source files
Change-Id: I4de34baf90979651223a28323010deb7aef21946
Signed-off-by: Mandeep Khinda <Mandeep.Khinda@amdocs.com>
Diffstat (limited to 'kubernetes/oneclick')
-rwxr-xr-x | kubernetes/oneclick/aai.sh | 7 | ||||
-rwxr-xr-x | kubernetes/oneclick/appc.sh | 8 | ||||
-rwxr-xr-x | kubernetes/oneclick/createAll.bash | 85 | ||||
-rwxr-xr-x | kubernetes/oneclick/dcae.sh | 2 | ||||
-rwxr-xr-x | kubernetes/oneclick/deleteAll.bash | 81 | ||||
-rwxr-xr-x | kubernetes/oneclick/message-router.sh | 7 | ||||
-rwxr-xr-x | kubernetes/oneclick/mso.sh | 7 | ||||
-rwxr-xr-x | kubernetes/oneclick/policy.sh | 12 | ||||
-rwxr-xr-x | kubernetes/oneclick/portal.sh | 7 | ||||
-rwxr-xr-x | kubernetes/oneclick/robot.sh | 5 | ||||
-rwxr-xr-x | kubernetes/oneclick/sdc.sh | 9 | ||||
-rwxr-xr-x | kubernetes/oneclick/sdnc.sh | 8 | ||||
-rwxr-xr-x | kubernetes/oneclick/vid.sh | 6 |
13 files changed, 244 insertions, 0 deletions
diff --git a/kubernetes/oneclick/aai.sh b/kubernetes/oneclick/aai.sh new file mode 100755 index 0000000000..9a8e837093 --- /dev/null +++ b/kubernetes/oneclick/aai.sh @@ -0,0 +1,7 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "AAI....\n" +$KUBECTL_CMD/hbase-deployment.yaml +$KUBECTL_CMD/aai-deployment.yaml +$KUBECTL_CMD/modelloader-deployment.yaml diff --git a/kubernetes/oneclick/appc.sh b/kubernetes/oneclick/appc.sh new file mode 100755 index 0000000000..2db7b210b2 --- /dev/null +++ b/kubernetes/oneclick/appc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "App-c....\n" +$KUBECTL_CMD/db-deployment.yaml +$KUBECTL_CMD/appc-deployment.yaml +$KUBECTL_CMD/dgbuilder-deployment.yaml diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash new file mode 100755 index 0000000000..6e62c6bec4 --- /dev/null +++ b/kubernetes/oneclick/createAll.bash @@ -0,0 +1,85 @@ +#!/bin/bash + +usage() { + cat <<EOF +Usage: $0 [PARAMs] +-u : Display usage +-n [NAMESPACE] : Kubernetes namespace (required) +-s false : Exclude services (default: true) +-a [APP] : Specify a specific ONAP component (default: all) + from the following choices: + sdc, aai ,mso, message-router, robot, + vid, sdnc, portal, policy, appc +EOF +} + +create_namespace() { + kubectl create namespace $1-$2 +} + +create_service() { + kubectl --namespace $1-$2 create -f ../$2/all-services.yaml +} + +#MAINs +NS= +INCL_SVC=true +APP= + +while getopts ":n:u:s:a:" PARAM; do + case $PARAM in + u) + usage + exit 1 + ;; + n) + NS=${OPTARG} + ;; + s) + INCL_SVC=${OPTARG} + ;; + a) + APP=${OPTARG} + if [[ -z $APP ]]; then + usage + exit 1 + fi + ;; + ?) + usage + exit + ;; + esac +done + +if [[ -z $NS ]]; then + usage + exit 1 +fi + +if [[ ! -z "$APP" ]]; then + ONAP_APPS=($APP) +else + ONAP_APPS=('sdc' 'aai' 'mso' 'message-router' 'robot' 'vid' 'sdnc' 'portal' 'policy' 'appc') +fi + +printf "\n********** Creating up ONAP: ${ONAP_APPS[*]}\n" + +for i in ${ONAP_APPS[@]}; do + printf "\nCreating namespaces **********\n" + create_namespace $NS $i + + if [[ "$INCL_SVC" == true ]]; then + printf "\nCreating services **********\n" + create_service $NS $i + fi + + printf "\n" +done + +printf "\n\n********** Creating deployments for ${ONAP_APPS[*]} ********** \n" +for i in ${ONAP_APPS[@]}; do + /bin/bash $i.sh $NS $i 'create' +done + +printf "**** Done ****" diff --git a/kubernetes/oneclick/dcae.sh b/kubernetes/oneclick/dcae.sh new file mode 100755 index 0000000000..8a95e0bfff --- /dev/null +++ b/kubernetes/oneclick/dcae.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "DCAE under construction" diff --git a/kubernetes/oneclick/deleteAll.bash b/kubernetes/oneclick/deleteAll.bash new file mode 100755 index 0000000000..8d145f945a --- /dev/null +++ b/kubernetes/oneclick/deleteAll.bash @@ -0,0 +1,81 @@ +#!/bin/bash +delete_namespace() { + kubectl delete namespace $1-$2 +} + +delete_service() { + kubectl --namespace $1-$2 delete -f ../$2/all-services.yaml +} + +usage() { + cat <<EOF +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, + vid, sdnc, portal, policy, appc +EOF +} + +#MAINs +NS= +INCL_SVC=false +APP= + +while getopts ":n:u:s:a:" PARAM; do + case $PARAM in + u) + usage + exit 1 + ;; + n) + NS=${OPTARG} + ;; + s) + INCL_SVC=${OPTARG} + ;; + a) + APP=${OPTARG} + if [[ -z $APP ]]; then + usage + exit 1 + fi + ;; + ?) + usage + exit + ;; + esac +done + +if [[ -z $NS ]]; then + usage + exit 1 +fi + +if [[ ! -z "$APP" ]]; then + ONAP_APPS=($APP) +else + ONAP_APPS=('sdc' 'aai' 'mso' 'message-router' 'robot' 'vid' 'sdnc' 'portal' 'policy' 'appc') +fi + +printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n" + +for i in ${ONAP_APPS[@]}; do + + if [[ "$INCL_SVC" == true ]]; then + printf "\nDeleting services **********\n" + delete_service $NS $i + delete_namespace $NS $i + fi + + # delete the deployments + /bin/bash $i.sh $NS $i 'delete' + +done + + +printf "\n********** Gone **********\n" diff --git a/kubernetes/oneclick/message-router.sh b/kubernetes/oneclick/message-router.sh new file mode 100755 index 0000000000..0369fd1a18 --- /dev/null +++ b/kubernetes/oneclick/message-router.sh @@ -0,0 +1,7 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "Message Router....\n" +$KUBECTL_CMD/message-router-zookeeper.yaml +$KUBECTL_CMD/message-router-kafka.yaml +$KUBECTL_CMD/message-router-dmaap.yaml diff --git a/kubernetes/oneclick/mso.sh b/kubernetes/oneclick/mso.sh new file mode 100755 index 0000000000..360f3b80d9 --- /dev/null +++ b/kubernetes/oneclick/mso.sh @@ -0,0 +1,7 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "MSO....\n" + +$KUBECTL_CMD/db-deployment.yaml +$KUBECTL_CMD/mso-deployment.yaml diff --git a/kubernetes/oneclick/policy.sh b/kubernetes/oneclick/policy.sh new file mode 100755 index 0000000000..85e58f6468 --- /dev/null +++ b/kubernetes/oneclick/policy.sh @@ -0,0 +1,12 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "Policy....\n" + +$KUBECTL_CMD/dep-maria.yaml +$KUBECTL_CMD/dep-nexus.yaml +$KUBECTL_CMD/dep-pap.yaml +$KUBECTL_CMD/dep-pdp.yaml +$KUBECTL_CMD/dep-brmsgw.yaml +$KUBECTL_CMD/dep-pypdp.yaml +$KUBECTL_CMD/dep-drools.yaml diff --git a/kubernetes/oneclick/portal.sh b/kubernetes/oneclick/portal.sh new file mode 100755 index 0000000000..49ce39e4bf --- /dev/null +++ b/kubernetes/oneclick/portal.sh @@ -0,0 +1,7 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "Portal....\n" +$KUBECTL_CMD/portal-mariadb-deployment.yaml +$KUBECTL_CMD/portal-apps-deployment.yaml +$KUBECTL_CMD/portal-vnc-dep.yaml diff --git a/kubernetes/oneclick/robot.sh b/kubernetes/oneclick/robot.sh new file mode 100755 index 0000000000..99a5748f7a --- /dev/null +++ b/kubernetes/oneclick/robot.sh @@ -0,0 +1,5 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "Robot....\n" +$KUBECTL_CMD/robot-deployment.yaml diff --git a/kubernetes/oneclick/sdc.sh b/kubernetes/oneclick/sdc.sh new file mode 100755 index 0000000000..72a85cbe4b --- /dev/null +++ b/kubernetes/oneclick/sdc.sh @@ -0,0 +1,9 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "SDC....\n" +$KUBECTL_CMD/sdc-es.yaml +$KUBECTL_CMD/sdc-cs.yaml +$KUBECTL_CMD/sdc-kb.yaml +$KUBECTL_CMD/sdc-be.yaml +$KUBECTL_CMD/sdc-fe.yaml diff --git a/kubernetes/oneclick/sdnc.sh b/kubernetes/oneclick/sdnc.sh new file mode 100755 index 0000000000..d7390ba01b --- /dev/null +++ b/kubernetes/oneclick/sdnc.sh @@ -0,0 +1,8 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "SDNC....\n" +$KUBECTL_CMD/db-deployment.yaml +$KUBECTL_CMD/sdnc-deployment.yaml +$KUBECTL_CMD/dgbuilder-deployment.yaml +$KUBECTL_CMD/web-deployment.yaml diff --git a/kubernetes/oneclick/vid.sh b/kubernetes/oneclick/vid.sh new file mode 100755 index 0000000000..b88a3fb4a8 --- /dev/null +++ b/kubernetes/oneclick/vid.sh @@ -0,0 +1,6 @@ +#!/bin/bash +KUBECTL_CMD="kubectl --namespace $1-$2 $3 -f ../$2" + +printf "VID....\n" +$KUBECTL_CMD/vid-mariadb-deployment.yaml +$KUBECTL_CMD/vid-server-deployment.yaml |