diff options
author | 2018-11-15 04:40:01 +0000 | |
---|---|---|
committer | 2018-11-15 04:40:01 +0000 | |
commit | 014071321976a76e6f8fdc8588cbe51be9ea0967 (patch) | |
tree | 52389f1cbd24f7760464d5cbd53f0bae282e9f2d /src/vagrant/kubeadm/host_setup.sh | |
parent | 8c2602aa5e99381dfbf9210c0b4e3a82976052f3 (diff) | |
parent | 305eefa0439bef9f0edac786160ca8ed00e1942c (diff) |
Merge "rebase multus"
Diffstat (limited to 'src/vagrant/kubeadm/host_setup.sh')
-rw-r--r-- | src/vagrant/kubeadm/host_setup.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/vagrant/kubeadm/host_setup.sh b/src/vagrant/kubeadm/host_setup.sh new file mode 100644 index 0000000..d792119 --- /dev/null +++ b/src/vagrant/kubeadm/host_setup.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +set -ex + +cat << EOF | sudo tee /etc/hosts +127.0.0.1 localhost +192.168.1.05 registry +192.168.1.10 master +192.168.1.21 worker1 +192.168.1.22 worker2 +192.168.1.23 worker3 +EOF + +sudo apt-get update +sudo apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + software-properties-common + +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +sudo add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" +sudo apt-get update +sudo apt-get install -y docker-ce=18.03.1~ce-0~ubuntu +cat << EOF | sudo tee /etc/docker/daemon.json +{ + "insecure-registries": ["registry:5000"] +} +EOF +sudo service docker restart + +curl -s http://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list +deb http://apt.kubernetes.io/ kubernetes-xenial main +EOF +sudo apt-get update +sudo apt-get install -y --allow-unauthenticated kubelet=1.12.2-00 kubeadm=1.12.2-00 kubectl=1.12.2-00 kubernetes-cni=0.6.0-00 +echo 'Environment="KUBELET_EXTRA_ARGS=--feature-gates=DevicePlugins=true"' | sudo tee /etc/default/kubelet + +sudo modprobe ip_vs +sudo modprobe ip_vs_rr +sudo modprobe ip_vs_wrr +sudo modprobe ip_vs_sh +sudo swapoff -a +sudo systemctl daemon-reload +sudo systemctl stop kubelet +sudo systemctl start kubelet |