diff options
author | 2017-10-18 10:35:35 -0700 | |
---|---|---|
committer | 2017-10-18 10:37:24 -0700 | |
commit | 19fd2fd1a298b1f9325df115be77d26e3a4e5c3c (patch) | |
tree | 09c0c10021689aacee8b2d2a6a59fcfc6776fa98 | |
parent | 9c5dfa096799b39dac2518b6b7d3160495a34251 (diff) |
Align terms in deploy scripts; update approach to summaries
JIRA: MODELS-23
Change-Id: If355c963bf1985ea1d1fc79b92f22dade0b86505
Signed-off-by: Bryan Sullivan <bryan.sullivan@att.com>
-rw-r--r-- | tools/docker/demo_deploy.sh | 14 | ||||
-rw-r--r-- | tools/kubernetes/demo_deploy.sh | 53 | ||||
-rw-r--r-- | tools/prometheus/prometheus-tools.sh | 2 | ||||
-rw-r--r-- | tools/rancher/demo_deploy.sh | 38 |
4 files changed, 62 insertions, 45 deletions
diff --git a/tools/docker/demo_deploy.sh b/tools/docker/demo_deploy.sh index c2fc657..e25b19c 100644 --- a/tools/docker/demo_deploy.sh +++ b/tools/docker/demo_deploy.sh @@ -22,17 +22,17 @@ #. Grafana dashboard: http://<master_public_ip>:3000 #. #. Prerequisites: -#. - Ubuntu server for cluster nodes (admin/master and worker nodes) +#. - Ubuntu server for cluster nodes (master and worker nodes) #. - MAAS server as cluster admin for Rancher master/worker nodes #. - Password-less ssh key provided for node setup #. Usage: on the MAAS server #. $ git clone https://gerrit.opnfv.org/gerrit/models ~/models -#. $ bash ~/models/tools/docker/demo_deploy.sh <key> "<hosts>" <master_ip> -#. "<worker_ips>" [<extras>] +#. $ bash ~/models/tools/docker/demo_deploy.sh <key> "<hosts>" <master> +#. "<workers>" [<extras>] #. <key>: name of private key for cluster node ssh (in current folder) #. <hosts>: space separated list of hostnames managed by MAAS -#. <master_ip>: IP of master node -#. <worker_ips>: space separated list of worker node IPs +#. <master>: IP of master node +#. <workers>: space separated list of worker node IPs #. <extras>: optional name of script for extra setup functions as needed key=$1 @@ -60,8 +60,12 @@ ssh-add $key cd models/tools/prometheus bash prometheus-tools.sh all "$agent_ips" EOF + echo "All done!" echo "Demo app nginx is at http://$master:8080/ and on worker nodes port 8080" apiversion=$(curl http://$master:4243/version | jq -r '.ApiVersion') echo "Docker engine API is available at http://$master:4243" echo "API docs are at https://docs.docker.com/engine/api/v$apiversion/" +echo "Prometheus UI is available at http://$master:9090" +echo "Grafana dashboards are available at http://$master:3000 (login as admin/admin)" +echo "Grafana API is available at http://admin:admin@$master:3000/api/v1/query?query=<string>" diff --git a/tools/kubernetes/demo_deploy.sh b/tools/kubernetes/demo_deploy.sh index 7138224..6ac03b5 100644 --- a/tools/kubernetes/demo_deploy.sh +++ b/tools/kubernetes/demo_deploy.sh @@ -20,29 +20,29 @@ #. - prometheus + grafana for cluster monitoring/stats #. - cloudify + kubernetes plugin and a demo hello world (nginx) app installed #. will be setup with: -#. Prometheus dashboard: http://<admin_public_ip>:9090 -#. Grafana dashboard: http://<admin_public_ip>:3000 +#. Prometheus dashboard: http://<master_public_ip>:9090 +#. Grafana dashboard: http://<master_public_ip>:3000 #. #. Prerequisites: -#. - Ubuntu server for kubernetes cluster nodes (admin/master and agent nodes) -#. - MAAS server as cluster admin for kubernetes master/agent nodes +#. - Ubuntu server for kubernetes cluster nodes (master and worker nodes) +#. - MAAS server as cluster admin for kubernetes master/worker nodes #. - Password-less ssh key provided for node setup #. Usage: on the MAAS server #. $ git clone https://gerrit.opnfv.org/gerrit/models ~/models -#. $ bash ~/models/tools/kubernetes/demo_deploy.sh <key> "<hosts>" <admin ip> -#. "<agent ips>" <pub-net> <priv-net> [<extras>] +#. $ bash ~/models/tools/kubernetes/demo_deploy.sh <key> "<hosts>" <master> +#. "<workers>" <pub-net> <priv-net> [<extras>] #. <key>: name of private key for cluster node ssh (in current folder) #. <hosts>: space separated list of hostnames managed by MAAS -#. <admin ip>: IP of cluster admin node -#. <agent_ips>: space separated list of agent node IPs +#. <master>: IP of cluster master node +#. <workers>: space separated list of agent node IPs #. <pub-net>: CID formatted public network #. <priv-net>: CIDR formatted private network (may be same as pub-net) #. <extras>: optional name of script for extra setup functions as needed key=$1 nodes="$2" -admin_ip=$3 -agent_ips="$4" +master=$3 +workers="$4" priv_net=$5 pub_net=$6 extras=$7 @@ -51,36 +51,45 @@ source ~/models/tools/maas/deploy.sh $1 "$2" $5 eval `ssh-agent` ssh-add $key if [[ "x$extras" != "x" ]]; then source $extras; fi -scp -o StrictHostKeyChecking=no $key ubuntu@$admin_ip:/home/ubuntu/$key +scp -o StrictHostKeyChecking=no $key ubuntu@$master:/home/ubuntu/$key echo "Setting up kubernetes..." scp -o StrictHostKeyChecking=no ~/models/tools/kubernetes/k8s-cluster.sh \ - ubuntu@$admin_ip:/home/ubuntu/. -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip <<EOF + ubuntu@$master:/home/ubuntu/. +ssh -x -o StrictHostKeyChecking=no ubuntu@$master <<EOF exec ssh-agent bash ssh-add $key -bash k8s-cluster.sh all "$agent_ips" $priv_net $pub_net +bash k8s-cluster.sh all "$workers" $priv_net $pub_net EOF # TODO: Figure this out... Have to break the setup into two steps as something # causes the ssh session to end before the prometheus setup, if both scripts # are in the same ssh session echo "Setting up Prometheus..." -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip mkdir -p \ +ssh -x -o StrictHostKeyChecking=no ubuntu@$master mkdir -p \ /home/ubuntu/models/tools/prometheus scp -r -o StrictHostKeyChecking=no ~/models/tools/prometheus/* \ - ubuntu@$admin_ip:/home/ubuntu/models/tools/prometheus -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip <<EOF + ubuntu@$master:/home/ubuntu/models/tools/prometheus +ssh -x -o StrictHostKeyChecking=no ubuntu@$master <<EOF exec ssh-agent bash ssh-add $key cd models/tools/prometheus -bash prometheus-tools.sh all "$agent_ips" +bash prometheus-tools.sh all "$workers" EOF echo "Setting up cloudify..." scp -r -o StrictHostKeyChecking=no ~/models/tools/cloudify \ - ubuntu@$admin_ip:/home/ubuntu/. -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip \ + ubuntu@$master:/home/ubuntu/. +ssh -x -o StrictHostKeyChecking=no ubuntu@$master \ bash cloudify/k8s-cloudify.sh prereqs -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip \ +ssh -x -o StrictHostKeyChecking=no ubuntu@$master \ bash cloudify/k8s-cloudify.sh setup -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip \ +ssh -x -o StrictHostKeyChecking=no ubuntu@$master \ bash cloudify/k8s-cloudify.sh demo + echo "All done!" +export NODE_PORT=$(ssh -x -o StrictHostKeyChecking=no ubuntu@$master kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services dw-dokuwiki) +export NODE_IP=$(ssh -x -o StrictHostKeyChecking=no ubuntu@$master kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}") +echo "Helm chart demo app dokuwiki is available at http://$NODE_IP:$NODE_PORT/" +# TODO update Cloudify demo app to have public exposed service address +echo "Cloudify-deployed demo app nginx is available at TBD" +echo "Prometheus UI is available at http://$master:9090" +echo "Grafana dashboards are available at http://$master:3000 (login as admin/admin)" +echo "Grafana API is available at http://admin:admin@$master:3000/api/v1/query?query=<string>" diff --git a/tools/prometheus/prometheus-tools.sh b/tools/prometheus/prometheus-tools.sh index 5c7a884..ebf9eca 100644 --- a/tools/prometheus/prometheus-tools.sh +++ b/tools/prometheus/prometheus-tools.sh @@ -130,7 +130,7 @@ EOF echo "${FUNCNAME[0]}: $job at $eip" done echo "${FUNCNAME[0]}: Prometheus dashboard is available at http://$host_ip:9090" - echo "Prometheus dashboard is available at http://$host_ip:9090" auto>/tmp/summary + echo "Prometheus dashboard is available at http://$host_ip:9090" >>/tmp/summary } function connect_grafana() { diff --git a/tools/rancher/demo_deploy.sh b/tools/rancher/demo_deploy.sh index bdf60ab..3054baf 100644 --- a/tools/rancher/demo_deploy.sh +++ b/tools/rancher/demo_deploy.sh @@ -22,51 +22,55 @@ #. Grafana dashboard: http://<master_public_ip>:3000 #. #. Prerequisites: -#. - Ubuntu server for Rancher cluster nodes (admin/master and agent nodes) -#. - MAAS server as cluster admin for Rancher master/agent nodes +#. - Ubuntu server for Rancher cluster nodes (master and worker nodes) +#. - MAAS server as cluster admin for Rancher master/worker nodes #. - Password-less ssh key provided for node setup #. Usage: on the MAAS server #. $ git clone https://gerrit.opnfv.org/gerrit/models ~/models -#. $ bash ~/models/tools/rancher/demo_deploy.sh <key> "<hosts>" <master_ip> -#. "<agent ips>" [<extras>] +#. $ bash ~/models/tools/rancher/demo_deploy.sh <key> "<hosts>" <master> +#. "<workers>" [<extras>] #. <key>: name of private key for cluster node ssh (in current folder) #. <hosts>: space separated list of hostnames managed by MAAS -#. <master_ip>: IP of cluster admin node -#. <agent_ips>: space separated list of agent node IPs +#. <master>: IP of cluster master node +#. <workers>: space separated list of worker node IPs #. <extras>: optional name of script for extra setup functions as needed key=$1 nodes="$2" -admin_ip=$3 -agent_ips="$4" +master=$3 +workers="$4" extras=$5 source ~/models/tools/maas/deploy.sh $1 "$2" $5 eval `ssh-agent` ssh-add $key if [[ "x$extras" != "x" ]]; then source $extras; fi -scp -o StrictHostKeyChecking=no $key ubuntu@$admin_ip:/home/ubuntu/$key +scp -o StrictHostKeyChecking=no $key ubuntu@$master:/home/ubuntu/$key scp -o StrictHostKeyChecking=no ~/models/tools/rancher/rancher-cluster.sh \ - ubuntu@$admin_ip:/home/ubuntu/. + ubuntu@$master:/home/ubuntu/. echo "Setting up Rancher..." -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip <<EOF +ssh -x -o StrictHostKeyChecking=no ubuntu@$master <<EOF exec ssh-agent bash ssh-add $key -bash rancher-cluster.sh all "$agent_ips" +bash rancher-cluster.sh all "$workers" EOF # TODO: Figure this out... Have to break the setup into two steps as something # causes the ssh session to end before the prometheus setup, if both scripts # are in the same ssh session echo "Setting up Prometheus..." -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip mkdir -p \ +ssh -x -o StrictHostKeyChecking=no ubuntu@$master mkdir -p \ /home/ubuntu/models/tools/prometheus scp -r -o StrictHostKeyChecking=no ~/models/tools/prometheus/* \ - ubuntu@$admin_ip:/home/ubuntu/models/tools/prometheus -ssh -x -o StrictHostKeyChecking=no ubuntu@$admin_ip <<EOF + ubuntu@$master:/home/ubuntu/models/tools/prometheus +ssh -x -o StrictHostKeyChecking=no ubuntu@$master <<EOF exec ssh-agent bash ssh-add $key cd models/tools/prometheus -bash prometheus-tools.sh all "$agent_ips" +bash prometheus-tools.sh all "$workers" EOF + echo "All done!" -echo "Rancher server is accessible at http://$admin_ip:8080" +echo "Rancher UI is accessible at http://$master:8080" +echo "Prometheus UI is available at http://$master:9090" +echo "Grafana dashboards are available at http://$master:3000 (login as admin/admin)" +echo "Grafana API is available at http://admin:admin@$master:3000/api/v1/query?query=<string>" |