Roger Maitland | eb412c6 | 2018-05-31 14:09:09 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | DOCKER_VERSION=17.03 |
Mike Elliott | ed5ff71 | 2018-11-07 15:47:19 -0500 | [diff] [blame] | 4 | RANCHER_VERSION=1.6.22 |
| 5 | KUBECTL_VERSION=1.11.2 |
Michael O'Brien | 633217a | 2018-08-15 14:10:43 -0400 | [diff] [blame] | 6 | HELM_VERSION=2.9.1 |
Roger Maitland | eb412c6 | 2018-05-31 14:09:09 -0400 | [diff] [blame] | 7 | |
| 8 | # setup root access - default login: oom/oom - comment out to restrict access too ssh key only |
| 9 | sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config |
| 10 | sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config |
| 11 | service sshd restart |
| 12 | echo -e "oom\noom" | passwd root |
| 13 | |
| 14 | apt-get update |
| 15 | curl https://releases.rancher.com/install-docker/$DOCKER_VERSION.sh | sh |
| 16 | mkdir -p /etc/systemd/system/docker.service.d/ |
| 17 | cat > /etc/systemd/system/docker.service.d/docker.conf << EOF |
| 18 | [Service] |
| 19 | ExecStart= |
| 20 | ExecStart=/usr/bin/dockerd -H fd:// --insecure-registry=nexus3.onap.org:10001 |
| 21 | EOF |
| 22 | systemctl daemon-reload |
| 23 | systemctl restart docker |
| 24 | apt-mark hold docker-ce |
| 25 | |
| 26 | IP_ADDY=`ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}'` |
| 27 | HOSTNAME=`hostname` |
| 28 | |
| 29 | echo "$IP_ADDY $HOSTNAME" >> /etc/hosts |
| 30 | |
| 31 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 32 | |
| 33 | sudo apt-get install make -y |
| 34 | |
| 35 | sudo docker run -d --restart=unless-stopped -p 8080:8080 --name rancher_server rancher/server:v$RANCHER_VERSION |
| 36 | sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl |
| 37 | sudo chmod +x ./kubectl |
| 38 | sudo mv ./kubectl /usr/local/bin/kubectl |
| 39 | sudo mkdir ~/.kube |
| 40 | wget http://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz |
| 41 | sudo tar -zxvf helm-v${HELM_VERSION}-linux-amd64.tar.gz |
| 42 | sudo mv linux-amd64/helm /usr/local/bin/helm |
| 43 | |
| 44 | # nfs server |
| 45 | sudo apt-get install nfs-kernel-server -y |
| 46 | |
| 47 | sudo mkdir -p /nfs_share |
| 48 | sudo chown nobody:nogroup /nfs_share/ |
| 49 | |
| 50 | |
| 51 | exit 0 |