Installing Kubernetes Cluster (1 Master and 2 Worker Nodes) using Vagrant (Kubeadm installation)
- Step 1:- Download Virtual Box and install it on your OS
- Step 2:- Download Vagrant and Install it (It needs to ask for restart).
- Step 3:- Download Git and Install it.
- Step 4:- Clone the git repo using the command
git clone https://github.com/kmitsolution/k8s.git
(note that calico network is installed in the vagrant file: C:\VMS\kubernetes-setup\k8s\K8s-Vagrant\bootstrap_kmaster) - Step 5:- Open Git Repo and Go to k8s/K8s-Vagrant/ on the command terminal
- Step 6:- Install some vagrant plugins by running the below command
vagrant plugin install vagrant-vbguest - Step 7:- Run the below command to create Kubernetes Cluster (It will take around 10-15 mins)
vagrant up - Step 8:- Connect to the Master server
vagrant ssh kmaster (password: vagrant) - Step 9:- on kmaster, type:
1. mkdir -p $HOME/.kube
2. sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
3. sudo chown $(id -u):$(id -g) $HOME/.kube/config - Step 10:- Verify the cluster is in ready state
kubectl get nodes