From 05bc6725c5d09adc25495c56e54af7a7ee155e49 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Wed, 24 Jan 2018 11:44:55 -0800 Subject: Update for refactored VES scripts JIRA: MODELS-2 Change-Id: I729fb1026bf9230ee14134d4d40dfebc2488107c Signed-off-by: Bryan Sullivan --- tools/cloudify/k8s-cloudify.sh | 7 +++++++ tools/kubernetes/demo_deploy.sh | 24 +++++++----------------- tools/kubernetes/k8s-cluster.sh | 4 ++-- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/tools/cloudify/k8s-cloudify.sh b/tools/cloudify/k8s-cloudify.sh index d7f18ba..5b1a0f5 100644 --- a/tools/cloudify/k8s-cloudify.sh +++ b/tools/cloudify/k8s-cloudify.sh @@ -87,6 +87,13 @@ function prereqs() { if [[ "$USER" == "ubuntu" ]]; then sudo apt-get install -y virtinst qemu-kvm libguestfs-tools virtualenv git \ python-pip + # workaround for virsh default network inactive + status=$(sudo virsh net-list --all | awk '/default/ {print $2}') + if [[ "$status" == "inactive" ]]; then + sudo ifconfig virbr0 down + sudo brctl delbr virbr0 + sudo virsh net-start default + fi else # installing libvirt is needed to ensure default network is pre-created sudo yum install -y libvirt diff --git a/tools/kubernetes/demo_deploy.sh b/tools/kubernetes/demo_deploy.sh index 273bd94..42a8499 100644 --- a/tools/kubernetes/demo_deploy.sh +++ b/tools/kubernetes/demo_deploy.sh @@ -164,32 +164,22 @@ if [[ ! -d ~/ves ]]; then echo; echo "$0 $(date): Cloning VES" git clone https://gerrit.opnfv.org/gerrit/ves ~/ves fi -ves_influxdb_host=$k8s_master:30886 -export ves_influxdb_host -ves_grafana_host=$k8s_master:30330 -export ves_grafana_host -ves_grafana_auth=admin:admin -export ves_grafana_auth -ves_kafka_hostname=$(ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $k8s_user@$k8s_master hostname) -export ves_kafka_hostname -ves_loglevel=$ves_loglevel -export ves_loglevel # Can't pass quoted strings in commands start=$((`date +%s`/60)) -exit -bash $HOME/ves/tools/demo_deploy.sh $k8s_key $k8s_user $k8s_master "$k8s_workers" cloudify -step_end "bash $HOME/ves/tools/demo_deploy.sh $k8s_key $k8s_user $k8s_master \"$k8s_workers\" cloudify" +bash $HOME/ves/tools/demo_deploy.sh $k8s_user $k8s_master cloudify +step_end "bash $HOME/ves/tools/demo_deploy.sh $k8s_user $k8s_master cloudify" echo; echo "$0 $(date): All done!" deploy_end=$((`date +%s`/60)) runtime=$((deploy_end-deploy_start)) log "Deploy \"$1\" duration = $runtime minutes" +source ~/ves/tools/ves_env.sh port=$(bash ~/models/tools/cloudify/k8s-cloudify.sh port nginx) -echo "Prometheus UI is available at http://$k8s_master:30990" -echo "InfluxDB API is available at http://$ves_influxdb_host/query&db=veseventsdb&q=" -echo "Grafana dashboards are available at http://$ves_grafana_host (login as $ves_grafana_auth)" -echo "Grafana API is available at http://$ves_grafana_auth@$ves_grafana_host/api/v1/query?query=" +#echo "Prometheus UI is available at http://$k8s_master:30990" +echo "InfluxDB API is available at http://$ves_influxdb_host:$ves_influxdb_port/query&db=veseventsdb&q=" +echo "Grafana dashboards are available at http://$ves_grafana_host:$ves_grafana_port (login as $ves_grafana_auth)" +echo "Grafana API is available at http://$ves_grafana_auth@$ves_grafana_host:$ves_grafana_port/api/v1/query?query=" echo "Kubernetes API is available at https://$k8s_master:6443/api/v1/" echo "Cloudify API access example: curl -u admin:admin --header 'Tenant: default_tenant' http://$k8s_master/api/v3.1/status" echo "Cloudify-deployed demo app nginx is available at http://$k8s_master:$port" diff --git a/tools/kubernetes/k8s-cluster.sh b/tools/kubernetes/k8s-cluster.sh index 65f19b5..0c94757 100644 --- a/tools/kubernetes/k8s-cluster.sh +++ b/tools/kubernetes/k8s-cluster.sh @@ -260,8 +260,8 @@ EOF fi ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ $USER@$worker bash prereqs.sh - scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/k8s_env.sh \ - $USER@$worker:/home/$USER/. + scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/k8s_env_$k8s_master_hostname.sh \ + $USER@$worker:/home/$USER/k8s_env.sh scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ start_worker.sh $USER@$worker:/home/$USER/. ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ -- cgit 1.2.3-korg