From 9fe5fdafe76396896953a480f82f99250665fdae Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Wed, 17 Jan 2018 19:04:08 -0800 Subject: Heat template for ONAP OOM deployment Change-Id: Iba9bdd6ea12152c48e4fd7c580476e02ebdaacdf Issue-ID: INT-381 Signed-off-by: Gary Wu --- test/ete/labs/huawei/onap-oom.yaml | 93 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 4 deletions(-) diff --git a/test/ete/labs/huawei/onap-oom.yaml b/test/ete/labs/huawei/onap-oom.yaml index 11767cf63..ccc8540c7 100644 --- a/test/ete/labs/huawei/onap-oom.yaml +++ b/test/ete/labs/huawei/onap-oom.yaml @@ -30,6 +30,8 @@ resources: __apt_proxy__: { get_param: apt_proxy } template: | #!/bin/bash -x + printenv + echo `hostname -I` `hostname` >> /etc/hosts mkdir -p /etc/docker cat > /etc/docker/daemon.json < /opt/config/rancher_ip_addr.txt echo `hostname -I` `hostname` >> /etc/hosts @@ -98,14 +102,16 @@ resources: sudo mv linux-amd64/helm /usr/local/bin/helm # Fix virtual memory allocation for onap-log:elasticsearch: - sysctl -w vm.max_map_count=262144 + echo "vm.max_map_count=262144" >> /etc/sysctl.conf + sysctl -p # install rancher agent echo export RANCHER_IP=__rancher_ip_addr__ > api-keys-rc source api-keys-rc + sleep 50 until curl -s -o projects.json -H "Accept: application/json" http://$RANCHER_IP:8080/v2-beta/projects; do - sleep 5 + sleep 10 done OLD_PID=$(jq -r '.data[0].id' projects.json) @@ -128,14 +134,14 @@ resources: source api-keys-rc until [ $(jq -r '.state' project.json) == "active" ]; do - sleep 1 + sleep 5 curl -s -H "Accept: application/json" http://$RANCHER_IP:8080/v1/projects/$PID | tee project.json done TID=$(curl -s -X POST -H "Accept: application/json" -H "Content-Type: application/json" http://$RANCHER_IP:8080/v1/projects/$PID/registrationTokens | jq -r '.id') touch token.json while [ $(jq -r .command token.json | wc -c) -lt 10 ]; do - sleep 1 + sleep 5 curl -s -X GET -H "Accept: application/json" http://$RANCHER_IP:8080/v1/projects/$PID/registrationToken/$TID | tee token.json done CMD=$(jq -r .command token.json) @@ -153,3 +159,82 @@ resources: # Update values.yaml to point to docker-proxy instead of nexus3: cd ~/oom/kubernetes perl -p -i -e 's/nexus3.onap.org:10001/__docker_proxy__/g' `find ./ -name values.yaml` + + KUBETOKEN=$(echo -n 'Basic '$(echo -n "$RANCHER_ACCESS_KEY:$RANCHER_SECRET_KEY" | base64 -w 0) | base64 -w 0) + + # create .kube/config + cat > ~/.kube/config <> ~/oom/kubernetes/config/onap-parameters.yaml <