From 68950cfed4850a7b1089ee2956f106ecd8ff132e Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Tue, 17 Oct 2017 13:33:32 -0700 Subject: [PATCH] Testing merged cloud-native models code JIRA: MODELS-23 Cleaned trailing whitespace. Fixed bugs with Rancher etc setup: - ssh -o where needed in demo_deploy.sh - Comment out Rancher-managed Grafana deploy - Pull dashboards direct from clone Change-Id: I02707488563a1db4262ebcdf735331707e36fa61 Signed-off-by: Bryan Sullivan --- tools/docker/demo_deploy.sh | 10 +++--- tools/docker/docker-cluster.sh | 20 ++++++------ tools/kubernetes/demo_deploy.sh | 25 +++++++-------- tools/kubernetes/k8s-cluster.sh | 30 +++++++++--------- tools/maas/deploy.sh | 8 ++--- tools/prometheus/prometheus-tools.sh | 16 +++++----- tools/rancher/demo_deploy.sh | 14 ++++----- tools/rancher/rancher-cluster.sh | 60 +++++++++++++++++++----------------- tools/traffic.sh | 4 +-- 9 files changed, 94 insertions(+), 93 deletions(-) diff --git a/tools/docker/demo_deploy.sh b/tools/docker/demo_deploy.sh index cbfe949..9454c0e 100644 --- a/tools/docker/demo_deploy.sh +++ b/tools/docker/demo_deploy.sh @@ -1,12 +1,12 @@ #!/bin/bash # Copyright 2017 AT&T Intellectual Property, Inc -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,7 @@ #. - prometheus + grafana for cluster monitoring/stats #. Prometheus dashboard: http://:9090 #. Grafana dashboard: http://:3000 -#. +#. #. Prerequisites: #. - Ubuntu server for cluster nodes (admin/master and worker nodes) #. - MAAS server as cluster admin for Rancher master/worker nodes @@ -47,7 +47,7 @@ ssh-add $key echo "Setting up Docker..." bash ~/models/tools/docker/docker-cluster.sh all $master "$workers" # 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 +# causes the ssh session to end before the prometheus setup, if both scripts # (k8s-cluster and prometheus-tools) are in the same ssh session echo "Setting up Prometheus..." scp -o StrictHostKeyChecking=no $key ubuntu@$master:/home/ubuntu/$key diff --git a/tools/docker/docker-cluster.sh b/tools/docker/docker-cluster.sh index 8c0aa69..7404e4a 100644 --- a/tools/docker/docker-cluster.sh +++ b/tools/docker/docker-cluster.sh @@ -1,20 +1,20 @@ #!/bin/bash # Copyright 2017 AT&T Intellectual Property, Inc -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -#. What this is: Deployment script for a mult-node docker-ce cluster. -#. Prerequisites: +#. What this is: Deployment script for a mult-node docker-ce cluster. +#. Prerequisites: #. - Ubuntu server for master and worker nodes #. Usage: #. $ git clone https://gerrit.opnfv.org/gerrit/models ~/models @@ -28,12 +28,12 @@ #. $ bash docker_cluster.sh setup "" #. Installs and starts master and worker nodes. #. $ bash docker_cluster.sh create -#. : Demo service name to start. +#. : Demo service name to start. #. Currently supported: nginx #. $ bash docker_cluster.sh delete #. : Service name to delete. #. $ bash docker_cluster.sh clean [] -#. : optional IP address of node to clean. +#. : optional IP address of node to clean. #. By default, cleans the entire cluster. #. @@ -113,7 +113,7 @@ function create_service() { ;; *) echo "${FUNCNAME[0]}: service $1 not setup for use with this script" - esac + esac if ! curl -X POST http://$master:4243/services/create -d @$1.json ; then echo "${FUNCNAME[0]}: service creation failed" @@ -142,8 +142,8 @@ function check_service() { echo "${FUNCNAME[0]}: service is not yet active, waiting 10 seconds" sleep 10 done - curl -s -o /tmp/resp http://$node:$port - if [[ $(grep -c "$match" /tmp/resp) == 0 ]]; then + curl -s -o /tmp/resp http://$node:$port + if [[ $(grep -c "$match" /tmp/resp) == 0 ]]; then not="NOT" fi echo "$service service is $not active at address http://$node:$port" diff --git a/tools/kubernetes/demo_deploy.sh b/tools/kubernetes/demo_deploy.sh index b3d165b..b7935de 100644 --- a/tools/kubernetes/demo_deploy.sh +++ b/tools/kubernetes/demo_deploy.sh @@ -1,12 +1,12 @@ #!/bin/bash # Copyright 2017 AT&T Intellectual Property, Inc -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,14 +22,14 @@ #. will be setup with: #. Prometheus dashboard: http://:9090 #. Grafana dashboard: http://:3000 -#. +#. #. Prerequisites: #. - Ubuntu server for kubernetes cluster nodes (admin/master and agent nodes) #. - MAAS server as cluster admin for kubernetes master/agent 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 "" +#. $ bash ~/models/tools/kubernetes/demo_deploy.sh "" #. "" [] #. : name of private key for cluster node ssh (in current folder) #. : space separated list of hostnames managed by MAAS @@ -51,24 +51,25 @@ ssh-add $key if [[ "x$extras" != "x" ]]; then source $extras; fi scp -o StrictHostKeyChecking=no $key ubuntu@$admin_ip:/home/ubuntu/$key echo "Setting up kubernetes..." -ssh -x ubuntu@$admin_ip <:9090 #. Grafana dashboard: http://:3000 -#. +#. #. Prerequisites: #. - Ubuntu server for Rancher cluster nodes (admin/master and agent nodes) #. - MAAS server as cluster admin for Rancher master/agent nodes @@ -47,17 +47,17 @@ ssh-add $key if [[ "x$extras" != "x" ]]; then source $extras; fi scp -o StrictHostKeyChecking=no $key ubuntu@$admin_ip:/home/ubuntu/$key echo "Setting up Rancher..." -ssh -x ubuntu@$admin_ip < # : address of the web service -- 2.16.6