Sudhakar Reddy | d10ae12 | 2018-08-16 17:40:56 +0530 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | DOCKER_VERSION=17.03 |
| 4 | KUBECTL_VERSION=1.8.10 |
| 5 | HELM_VERSION=2.9.1 |
| 6 | |
| 7 | # setup root access - default login: oom/oom - comment out to restrict access too ssh key only |
| 8 | sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config |
| 9 | sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config |
| 10 | service sshd restart |
| 11 | echo -e "oom\noom" | passwd root |
| 12 | |
| 13 | apt-get update |
| 14 | curl https://releases.rancher.com/install-docker/$DOCKER_VERSION.sh | sh |
| 15 | mkdir -p /etc/systemd/system/docker.service.d/ |
| 16 | cat > /etc/systemd/system/docker.service.d/docker.conf << EOF |
| 17 | [Service] |
| 18 | ExecStart= |
| 19 | ExecStart=/usr/bin/dockerd -H fd:// --insecure-registry=nexus3.onap.org:10001 |
| 20 | EOF |
| 21 | systemctl daemon-reload |
| 22 | systemctl restart docker |
| 23 | apt-mark hold docker-ce |
| 24 | |
| 25 | #IP_ADDY=`ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}'` |
| 26 | #HOSTNAME=`hostname` |
| 27 | |
| 28 | #echo "$IP_ADDY $HOSTNAME" >> /etc/hosts |
| 29 | |
| 30 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 31 | |
| 32 | sudo apt-get install make -y |
| 33 | |
| 34 | sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl |
| 35 | sudo chmod +x ./kubectl |
| 36 | sudo mv ./kubectl /usr/local/bin/kubectl |
| 37 | sudo mkdir ~/.kube |
| 38 | wget http://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz |
| 39 | sudo tar -zxvf helm-v${HELM_VERSION}-linux-amd64.tar.gz |
| 40 | sudo mv linux-amd64/helm /usr/local/bin/helm |
| 41 | |
| 42 | # install nfs |
| 43 | sudo apt-get install nfs-common -y |
| 44 | |
| 45 | MASTER_IP=$1 |
| 46 | |
| 47 | #Create NFS directory |
| 48 | sudo mkdir -p /dockerdata-nfs |
| 49 | |
| 50 | #Mount the remote NFS directory to the local one |
| 51 | sudo mount $MASTER_IP:/dockerdata-nfs /dockerdata-nfs/ |
| 52 | echo "$MASTER_IP:/dockerdata-nfsĀ /dockerdata-nfs nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0" | sudo tee -a /etc/fstab |
| 53 | |
| 54 | exit 0 |