Skip to content

Vagrantfile & Scripts to setup Kubernetes Cluster using Kubeadm for CKA, CKAD and CKS practice environment

License

Notifications You must be signed in to change notification settings

KamQb/vagrant-kubeadm-kubernetes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrantfile and Scripts to Automate Kubernetes Setup using Kubeadm [Practice Environment for CKA/CKAD and CKS Exams]

Fork info

This is based both on Devopscube cluster vagrant and Pluralsight - Anthony Nocentino - Kubernetes Installation and Configuration Fundamentals

Kubernetes installed using kubeadm, with Containerd runtime. Ubuntu images updated to 22.04. Kubernetes version 1.25.4

Documentation

Current k8s version for CKA, CKAD and CKS exam: 1.25

Prerequisites

  1. Working Vagrant setup
  2. VMs are using 18GB of Ram and 10 vCPUs

For MAC/Linux Users

Latest version of Virtualbox for Mac/Linux can cause issues because you have to create/edit the /etc/vbox/networks.conf file and add:

* 0.0.0.0/0 ::/0

or run below commands

sudo mkdir -p /etc/vbox/
echo "* 0.0.0.0/0 ::/0" | sudo tee -a /etc/vbox/networks.conf

So that the host only networks can be in any range, not just 192.168.56.0/21 as described here: https://discuss.hashicorp.com/t/vagrant-2-2-18-osx-11-6-cannot-create-private-network/30984/23

Usage/Examples

To provision the cluster, execute the following commands.

git clone https://github.com/scriptcamp/vagrant-kubeadm-kubernetes.git
cd vagrant-kubeadm-kubernetes
vagrant up

Set Kubeconfig file variable

cd vagrant-kubeadm-kubernetes
cd configs
export KUBECONFIG=$(pwd)/config

or you can copy the config file to .kube directory.

cp config ~/.kube/

Kubernetes Dashboard URL

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/overview?namespace=kubernetes-dashboard

Kubernetes login token

Vagrant up will create the admin user token and saves in the configs directory.

cd vagrant-kubeadm-kubernetes
cd configs
cat token

To shutdown the cluster,

vagrant halt

To restart the cluster,

vagrant up

To destroy the cluster,

vagrant destroy -f

About

Vagrantfile & Scripts to setup Kubernetes Cluster using Kubeadm for CKA, CKAD and CKS practice environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%