This project provides a basic setup of a Kubernetes nodes with Vagrant.
- Vagrant
- VirtualBox
You can change these properties in Vagrantfile:
- CPUS = 2
- MEMORY = "4096"
- USER_NAME = "ubuntu"
- PASSWORD = "ubuntu"
- KEYMAP = "de"
- KUBERNETES_VERSION="1.26.2"
- KUBERNETES_DASHBOARD_VERSION="2.7.0"
- CP_IP="192.168.50.10"
- POD_SUBNET_CIDR="192.168.0.0/16"
- NODE_IP_RANGE="192.168.50." # keep the last number empty
- NUMBER_OF_NODES = 1
There are provisioners for CRI-O (crio) and containerd. CRI-O is used in the default setup. Choose one of the provisioners in Vagrantfile in the cp and node config. The container runtime must be the same for each node in the cluster.
The creation of the cluster is as simple as executing run.sh.
There are two ways to access the cluster: via kubectl or with the Kubernetes dashboard
You can find the configuration for kubectl in provisioner/tmp/config after the provisioning the cluster is done.
You can find the token for the Kubernetes Dashboard in provisioner/tmp/admin-token.txt after the provisioning the cluster is done.
To generate a new token just run: kubectl -n kubernetes-dashboard create token admin-user
This project is tested with VirtualBox. It should be possible to use the setup with other providers as well.