diff options
author | Bryan Sullivan <bryan.sullivan@att.com> | 2017-10-17 09:55:26 -0700 |
---|---|---|
committer | Bryan Sullivan <bryan.sullivan@att.com> | 2017-10-17 09:55:26 -0700 |
commit | b2c252cd8913ef15a00d63a391da1c8a8a17d739 (patch) | |
tree | ec09ee2ae95c995ed7a363c1dce7ee40c31a9f99 /tools/rancher/demo_deploy.sh | |
parent | 7ecbfa707b3b1b1ac65924b097e4ff9b72ad981f (diff) |
Merge AT&T WIP on modeled cloud-native stacks into Models
Change-Id: I646825bf7d1a9c1be9c00475028084f920c9d399
Signed-off-by: Bryan Sullivan <bryan.sullivan@att.com>
Diffstat (limited to 'tools/rancher/demo_deploy.sh')
-rw-r--r-- | tools/rancher/demo_deploy.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tools/rancher/demo_deploy.sh b/tools/rancher/demo_deploy.sh new file mode 100644 index 0000000..981b421 --- /dev/null +++ b/tools/rancher/demo_deploy.sh @@ -0,0 +1,65 @@ +#!/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: Complete scripted deployment of an experimental Rancher-based +#. cloud-native application platform. When complete, Rancher and the following +#. will be installed: +#. - nginx and dokuwiki as demo applications +#. - prometheus + grafana for cluster monitoring/stats +#. Prometheus dashboard: http://<master_public_ip>:9090 +#. 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 +#. - 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>] +#. <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 +#. <extras>: optional name of script for extra setup functions as needed + +key=$1 +nodes="$2" +admin_ip=$3 +agent_ips="$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 +echo "Setting up Rancher..." +ssh -x ubuntu@$admin_ip <<EOF +exec ssh-agent bash +ssh-add $key +git clone https://gerrit.opnfv.org/gerrit/models +bash models/tools/rancher/rancher-cluster.sh all "$agent_ips" +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 +# (k8s-cluster and prometheus-tools) are in the same ssh session +echo "Setting up Prometheus..." +ssh -x ubuntu@$admin_ip <<EOF +exec ssh-agent bash +ssh-add $key +bash models/tools/prometheus/prometheus-tools.sh all "$agent_ips" +EOF +echo "All done!" |