K8-Cluster Setup

How to Setup Kubernetes Cluster on window laptop.

1. Install Virtual Box.

Downloads – Oracle VM VirtualBox

2. Install Vagrant.

Install | Vagrant | HashiCorp Developer

3.  Clone the repo 

git clone https://github.com/PGPAWAN/kubernetes_setup.git

4. Open the Command Prompt and go to the path of kubernetes_setup.

5. Open the vagrant file and see we have mention the no. of master and worker node required to setup the Kubernetes clusters.

# If this number is changed, remember to update setup-hosts.sh script with the new hosts IP details in /etc/hosts of each VM.

NUM_MASTER_NODE = 1

NUM_WORKER_NODE = 2


IP_NW = "192.168.56."

MASTER_IP_START = 1

NODE_IP_START = 2

5. Run Vagrant status, this command will tell you that vagrant will bring up three cluster in Virtual box with these name and the current state is not created.





6. If, you have already running cluster run vagrant destroy to clean.

7. Now you are ready to bring up the Kubernetes clusters, Run Vagrant up




This will download the ubuntu/bionic64 image and setup three VM in virtual box.

 



8. Now nodes are provisioned in Virtual box and to connect to any nodes you have to run Run Vagrant ssh <kubemaster| kubenode01 | kubenode02>