diff options
-rw-r--r-- | src/vagrant/kubeadm_basic/Vagrantfile | 4 | ||||
-rw-r--r-- | src/vagrant/kubeadm_basic/host_setup.sh | 21 | ||||
-rw-r--r-- | src/vagrant/kubeadm_basic/worker_setup.sh | 1 |
3 files changed, 10 insertions, 16 deletions
diff --git a/src/vagrant/kubeadm_basic/Vagrantfile b/src/vagrant/kubeadm_basic/Vagrantfile index 9320074..54b6b59 100644 --- a/src/vagrant/kubeadm_basic/Vagrantfile +++ b/src/vagrant/kubeadm_basic/Vagrantfile @@ -3,13 +3,13 @@ $num_workers=2 Vagrant.require_version ">= 1.8.6" Vagrant.configure("2") do |config| - config.vm.box = "ceph/ubuntu-xenial" + config.vm.box = "generic/ubuntu1804" config.vm.provider :libvirt do |libvirt| libvirt.memory = 4096 libvirt.cpus = 4 end - config.vm.synced_folder "../..", "/src" + config.vm.synced_folder ".", "/vagrant" config.vm.provision "shell", path: "host_setup.sh", privileged: false config.vm.define "master" do |config| diff --git a/src/vagrant/kubeadm_basic/host_setup.sh b/src/vagrant/kubeadm_basic/host_setup.sh index 6c112d7..2094628 100644 --- a/src/vagrant/kubeadm_basic/host_setup.sh +++ b/src/vagrant/kubeadm_basic/host_setup.sh @@ -2,6 +2,11 @@ set -ex +sudo systemctl stop systemd-resolved +cat << EOF | sudo tee /etc/resolv.conf +nameserver 8.8.8.8 +EOF + cat << EOF | sudo tee /etc/hosts 127.0.0.1 localhost 192.168.1.10 master @@ -11,26 +16,14 @@ cat << EOF | sudo tee /etc/hosts 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.06.0~ce~3-0~ubuntu +sudo apt-get install -y docker.io 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.1-00 kubeadm=1.12.1-00 kubectl=1.12.1-00 kubernetes-cni=0.6.0-00 +sudo apt-get install -y --allow-unauthenticated kubelet=1.15.2-00 kubeadm=1.15.2-00 kubectl=1.15.2-00 kubernetes-cni=0.7.5-00 sudo sed -i '9i\Environment="KUBELET_EXTRA_ARGS=--feature-gates=DevicePlugins=true"' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf sudo modprobe ip_vs diff --git a/src/vagrant/kubeadm_basic/worker_setup.sh b/src/vagrant/kubeadm_basic/worker_setup.sh index 74e4178..42477e6 100644 --- a/src/vagrant/kubeadm_basic/worker_setup.sh +++ b/src/vagrant/kubeadm_basic/worker_setup.sh @@ -1,4 +1,5 @@ #!/bin/bash set -ex +sleep 120 sudo kubeadm join --discovery-token-unsafe-skip-ca-verification --token 8c5adc.1cec8dbf339093f0 192.168.1.10:6443 || true |