onap on kubernetes source files
Change-Id: I4de34baf90979651223a28323010deb7aef21946
Signed-off-by: Mandeep Khinda <Mandeep.Khinda@amdocs.com>
diff --git a/kubernetes/oneclick/aai.sh b/kubernetes/oneclick/aai.sh
new file mode 100755
index 0000000..9a8e837
--- /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 0000000..2db7b21
--- /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 0000000..6e62c6b
--- /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 0000000..8a95e0b
--- /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 0000000..8d145f9
--- /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 0000000..0369fd1
--- /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 0000000..360f3b8
--- /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 0000000..85e58f6
--- /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 0000000..49ce39e
--- /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 0000000..99a5748
--- /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 0000000..72a85cb
--- /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 0000000..d7390ba
--- /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 0000000..b88a3fb
--- /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