aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/oneclick
diff options
context:
space:
mode:
authorMandeep Khinda <mandeep.khinda@amdocs.com>2017-08-25 03:31:17 +0000
committerMandeep Khinda <mandeep.khinda@amdocs.com>2017-08-25 03:41:20 +0000
commit0e8f8899ca6fdc589316c59f90f8f7283bbfad49 (patch)
tree7c3ed2c2b519b365572ca4a3539320164511c4bd /kubernetes/oneclick
parentdeab10d15301b12eee943d7c6151c4300ba2ac2a (diff)
refactor helm files to use namespace prefix
-removed the full namespace from each template. better lets us reuse variables. -made secret end up in a configurable namespace -fixed some bugs where secrets were missing -updated createAll and delete to make use of namespace prefix removing the need for seds to replace the word onap. *** all containers at this point come up in my env. except for aai model loader which is failing cause its still at 1.0 and its trying to talk to a 1.1 sdc and it doesnt auth properly. *** Issue-ID:OOM-215 Change-Id: I15815a01469786a391e272fde4bdaa53ff48091c Signed-off-by: Mandeep Khinda <mandeep.khinda@amdocs.com>
Diffstat (limited to 'kubernetes/oneclick')
-rwxr-xr-xkubernetes/oneclick/createAll.bash19
-rwxr-xr-xkubernetes/oneclick/deleteAll.bash10
-rw-r--r--kubernetes/oneclick/setenv.bash1
3 files changed, 7 insertions, 23 deletions
diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash
index 95dd809027..829f27a4df 100755
--- a/kubernetes/oneclick/createAll.bash
+++ b/kubernetes/oneclick/createAll.bash
@@ -25,7 +25,7 @@ create_registry_key() {
}
create_onap_helm() {
- helm install ../$2/ --name $2
+ helm install ../$2/ --name $2 --namespace $1 --set nsPrefix=$1
}
configure_app() {
@@ -39,21 +39,7 @@ configure_app() {
if [ -e "$2/Chart.yaml" ]; then
sed -i-- 's/nodePort: [0-9]\{2\}[02468]\{1\}/nodePort: '"$4"'/g' $3/all-services.yaml
sed -i-- 's/nodePort: [0-9]\{2\}[13579]\{1\}/nodePort: '"$5"'/g' $3/all-services.yaml
- sed -i "s/onap-/$1-/g" ../$2/values.yaml
fi
-
-
- # replace the default 'onap' namespace qualification of K8s hostnames within
- # the config files
- # note: this will create a '-template' file within the component's directory
- # this is not ideal and should be addressed (along with the replacement
- # of sed commands for configuration) by the future configuration
- # user stories (ie. OOM-51 to OOM-53)
- find $3 -type f -exec sed -i -- "s/onap-/$1-/g" {} \;
-
- # replace the default '/dockerdata-nfs/onapdemo' volume mount paths
- find $3 -iname "*.yaml" -type f -exec sed -i -e 's/dockerdata-nfs\/[a-zA-Z0-9\\-]*\//dockerdata-nfs\/'"$1"'\//g' {} \;
- rm -f $3/*.yaml-e
}
@@ -130,7 +116,7 @@ for i in ${HELM_APPS[@]}; do
create_namespace $NS $i
printf "\nCreating registry secret **********\n"
- create_registry_key $NS $i $ONAP_DOCKER_REGISTRY_KEY $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
+ create_registry_key $NS $i ${NS}-docker-registry-key $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
printf "\nCreating deployments and services **********\n"
_FILES_PATH=$(echo ../$i/templates)
@@ -141,4 +127,3 @@ for i in ${HELM_APPS[@]}; do
done
printf "\n**** Done ****\n"
-
diff --git a/kubernetes/oneclick/deleteAll.bash b/kubernetes/oneclick/deleteAll.bash
index dfa75b59c4..33ecb320e5 100755
--- a/kubernetes/oneclick/deleteAll.bash
+++ b/kubernetes/oneclick/deleteAll.bash
@@ -5,15 +5,15 @@
delete_namespace() {
_NS=$1-$2
kubectl delete namespace $_NS
- printf "Waiting for namespace $_NS termination...\n"
- while kubectl get namespaces $_NS > /dev/null 2>&1; do
- sleep 2
- done
+ printf "Waiting for namespace $_NS termination...\n"
+ while kubectl get namespaces $_NS > /dev/null 2>&1; do
+ sleep 2
+ done
printf "Namespace $_NS deleted.\n\n"
}
delete_registry_key() {
- kubectl --namespace $1-$2 delete secret onap-docker-registry-key
+ kubectl --namespace $1-$2 delete secret ${1}-docker-registry-key
}
delete_app_helm() {
diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash
index c7f3aba024..8fd8cd4d3c 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' '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}
ONAP_DOCKER_PASS=${ONAP_DOCKER_PASS:-docker}