Andy Bavier | facd0be | 2018-05-24 15:56:31 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright 2017-present Open Networking Foundation |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | set -xe |
| 18 | |
| 19 | # This script assumes the following repos exist |
| 20 | # ~/cord/automation-tools |
| 21 | |
| 22 | # Location of 'cord' directory for checkouts on the local system |
| 23 | CORDDIR="${CORDDIR:-${HOME}/cord}" |
| 24 | |
| 25 | [ ! -d "$CORDDIR" ] && mkdir -p "$CORDDIR" |
| 26 | [ ! -d "$CORDDIR"/automation-tools ] && cd "$CORDDIR" && git clone https://gerrit.opencord.org/automation-tools |
| 27 | [ ! -d "$CORDDIR"/helm-charts ] && cd "$CORDDIR" && git clone https://gerrit.opencord.org/helm-charts |
| 28 | |
| 29 | |
| 30 | # Install K8S, Helm, Openstack |
| 31 | "$CORDDIR"/automation-tools/openstack-helm/openstack-helm-dev-setup.sh |
| 32 | |
| 33 | |
Andy Bavier | facd0be | 2018-05-24 15:56:31 -0700 | [diff] [blame] | 34 | # Add keys for VTN |
| 35 | [ ! -e ~/.ssh/id_rsa ] && ssh-keygen -f ~/.ssh/id_rsa -t rsa -N "" |
| 36 | cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys |
| 37 | cp ~/.ssh/id_rsa "$CORDDIR"/helm-charts/xos-profiles/base-openstack/files/node_key |
| 38 | |
| 39 | # Add dummy fabric interface |
| 40 | sudo modprobe dummy |
| 41 | sudo ip link set name fabric dev dummy0 |
| 42 | sudo ifconfig fabric up |
| 43 | |
| 44 | |
| 45 | # Install charts for M-CORD |
| 46 | cd "$CORDDIR"/helm-charts |
| 47 | helm dep update ./xos-core |
| 48 | helm upgrade --install xos-core ./xos-core |
| 49 | ~/openstack-helm/tools/deployment/common/wait-for-pods.sh default |
| 50 | |
| 51 | helm dep update ./xos-profiles/base-openstack |
| 52 | helm upgrade --install base-openstack ./xos-profiles/base-openstack \ |
| 53 | --set computeNodes.master.name="$( hostname )" \ |
| 54 | --set vtn-service.sshUser="$( whoami )" |
| 55 | ~/openstack-helm/tools/deployment/common/wait-for-pods.sh default |
| 56 | |
| 57 | helm upgrade --install onos-cord ./onos |
| 58 | ~/openstack-helm/tools/deployment/common/wait-for-pods.sh default |
| 59 | |
| 60 | helm dep update ./xos-profiles/mcord |
| 61 | helm upgrade --install mcord ./xos-profiles/mcord \ |
| 62 | --set global.proxySshUser="$( whoami )" |
| 63 | ~/openstack-helm/tools/deployment/common/wait-for-pods.sh default |
| 64 | |
| 65 | |
| 66 | # Firewall VNC ports for security |
| 67 | sudo ufw default allow incoming |
| 68 | sudo ufw default allow outgoing |
| 69 | sudo ufw default allow routed |
| 70 | sudo ufw deny proto tcp from any to any port 5900:5950 comment 'vnc' |
| 71 | sudo ufw --force enable |
| 72 | |
| 73 | |
| 74 | echo "M-CORD has been successfully installed" |