Skip to content

Vagrant file to create a k8s cluster using Virtualbox provider

License

Notifications You must be signed in to change notification settings

DigitalOnUs/k8s_cluster_with_vagrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant Template to create k8s Cluster

This template will spun up the required VMs for the cluster using virtualbox

Prereqs

  1. Virtualbox app installed
  2. Text Editor

Steps to create the cluster

Variables Used in Vagrantfile

Variable Description
K8S_VERSION Define Version for K8s components (kubeadm, kubelet and kubectl)
NUM_MASTER_NODE Define the number of Master nodes to create
NUM_WORKER_NODE Define the number of worker nodes to create
IP_NW Defines the private CIDR for the nodes subnet
POD_NTWK_CIDR Define the CIDR range for the pods subnet

Edit the Vagrantfile accordingly to spun up the number of masters and nodes for your cluster

  1. Edit Vagrantfile and set the number of Master and Workers to create
  2. Enable Experimental vagrant feature with command export VAGRANT_EXPERIMENTAL="dependency_provisioners" for provisioning dependencies
  3. Run vagrant up
  4. wait until the cluster is up and connect to the controlplane vagrant ssh controlplane
  5. Install your prefered Network Add On
  6. check that you can get nodes and verify the version kubectl get nodes -o wide

About

Vagrant file to create a k8s cluster using Virtualbox provider

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages