summaryrefslogtreecommitdiffstats
path: root/kubernetes/oneclick/createAll.bash
diff options
context:
space:
mode:
authorMandeep Khinda <mandeep.khinda@amdocs.com>2017-09-21 18:22:10 +0000
committerMandeep Khinda <mandeep.khinda@amdocs.com>2017-09-21 20:27:26 +0000
commitde8d47e2497260fbe0530faf43eb51a074beef78 (patch)
treeaa6255626d9b61224fb1a419ce56a5f66086b43a /kubernetes/oneclick/createAll.bash
parent3e130463a0062cdb7aef9717c46ee5bc9958a32e (diff)
dcaegen2 bootstrap container in K8s
launching the dcaegen2 bootstrap container in OOM K8s. -based on dcaegen2/deployments/bootstrap/README-docker.md -requires an openstack private key pair file locally -requires mining and updating a yaml configuration file as per the comments in the sample file given. -unfortunately, my attempts to bundle the secret and configmap in the helm package didn't work out as they are external files so I create them using the createAll.bash script. Issue-ID: OOM-107 Change-Id: I221f60af66ea0f7e97ddd8b92819dce9aa6b5a81 Signed-off-by: Mandeep Khinda <mandeep.khinda@amdocs.com>
Diffstat (limited to 'kubernetes/oneclick/createAll.bash')
-rwxr-xr-xkubernetes/oneclick/createAll.bash35
1 files changed, 35 insertions, 0 deletions
diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash
index afe71af8e1..c8810aa615 100755
--- a/kubernetes/oneclick/createAll.bash
+++ b/kubernetes/oneclick/createAll.bash
@@ -39,11 +39,46 @@ create_registry_key() {
check_return_code $cmd
}
+configure_dcaegen2() {
+ if [ ! -s "$OPENSTACK_PRIVATE_KEY_PATH" ]
+ then
+ echo "ERROR: $OPENSTACK_PRIVATE_KEY_PATH does not exist or is empty. Cannot launch dcae gen2."
+ return 1
+ fi
+
+ cmd=`echo kubectl --namespace $1-$2 create secret generic $2-openstack-ssh-private-key --from-file=key=${OPENSTACK_PRIVATE_KEY_PATH}`
+ eval ${cmd}
+ check_return_code $cmd
+
+ if [ ! -s "$DCAEGEN2_CONFIG_INPUT_FILE_PATH" ]
+ then
+ echo "ERROR: $DCAEGEN2_CONFIG_INPUT_FILE_PATH does not exist or is empty. Cannot launch dcae gen2."
+ return 1
+ fi
+
+ cmd=`echo kubectl --namespace $1-$2 create configmap $2-config-inputs --from-file=inputs.yaml=${DCAEGEN2_CONFIG_INPUT_FILE_PATH}`
+ eval ${cmd}
+ check_return_code $cmd
+}
+
create_onap_helm() {
HELM_VALUES_ADDITION=""
if [[ ! -z $HELM_VALUES_FILEPATH ]]; then
HELM_VALUES_ADDITION="--values=$HELM_VALUES_FILEPATH"
fi
+ # Have to put a check for dcaegen2 because it requires external files to helm
+ # which should not be part of the Chart.
+ if [ "$2" = "dcaegen2" ];
+ then
+ configure_dcaegen2 $1 $2
+ local result=$?
+ if [ $result -ne 0 ]
+ then
+ echo "ERROR: dcaegen2 failed to configure: Pre-requisites not met. Skipping deploying it and continue"
+ return
+ fi
+ fi
+
cmd=`echo helm install $LOCATION/$2/ --name $1-$2 --namespace $1 --set nsPrefix=$1,nodePortPrefix=$3 ${HELM_VALUES_ADDITION}`
eval ${cmd}
check_return_code $cmd