Skip to content

Instantly share code, notes, and snippets.

@initcron
Last active August 2, 2021 06:40
Show Gist options
  • Save initcron/9833ea10739d013179789e83dc0b0a1b to your computer and use it in GitHub Desktop.
Save initcron/9833ea10739d013179789e83dc0b0a1b to your computer and use it in GitHub Desktop.

Install VirtualBox and Vagrant

TOOL VERSION LINK
VirtualBox latest https://www.virtualbox.org/wiki/Downloads
Vagrant latest https://www.vagrantup.com/downloads.html

Provisioning Vagrant Nodes

Clone repo if not already

git clone https://github.com/schoolofdevops/lab-setup.git


Launch environments with Vagrant

cd lab-setup/kubernetes/vagrant-kube-cluster

vagrant up

The above command will take some time and will download the image, setup VMs and configure those with everything required to configure the kubernetes cluster. This is also the setup where you may find and have to fix the majority of the issues.

Validating the Setup

Login to nodes

Open three different terminals to login to 3 nodes created with above command. For each terminal, before you run any vagrant command, make sure you are in the directory where Vagrantfile is.

Terminal 1

cd lab-setup/kubernetes/vagrant-kube-cluster
vagrant ssh kube-01
sudo su

docker version 

which kubectl  
which kubeadm 
which kubelet 

Terminal 2

cd lab-setup/kubernetes/vagrant-kube-cluster
vagrant ssh kube-02
sudo su

docker version 

which kubectl  
which kubeadm 
which kubelet 

Terminal 3

cd lab-setup/kubernetes/vagrant-kube-cluster
vagrant ssh kube-03
sudo su


docker version 

which kubectl  
which kubeadm 
which kubelet 

If you see the output for above commands, your environment is ready for kubernetes cluster setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment