_______ _______ ______ _______ ______ __ ______
/ \ / \ / \ / \ / \ / | / \
$$$$$$$ |$$$$$$$ |/$$$$$$ |$$$$$$$ |/$$$$$$ | $$ | __ /$$$$$$ | _______
$$ |__$$ |$$ |__$$ |$$ |__$$ |$$ | $$ |$$ |__$$ | $$ | / |$$ \__$$ | / |
$$ $$/ $$ $$< $$ $$ |$$ | $$ |$$ $$ | $$ |_/$$/ $$ $$< /$$$$$$$/
$$$$$$$/ $$$$$$$ |$$$$$$$$ |$$ | $$ |$$$$$$$$ | $$ $$< $$$$$$ |$$ \
$$ | $$ | $$ |$$ | $$ |$$ |__$$ |$$ | $$ | $$$$$$ \ $$ \__$$ | $$$$$$ |
$$ | $$ | $$ |$$ | $$ |$$ $$/ $$ | $$ | $$ | $$ |$$ $$/ / $$/
$$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$/ $$/ $$$$$$/ $$$$$$$/
- Code for the Python CLI is under the
tools
directory - Scripts for configuring the guests created by Vagrant are in the
scripts
directory
This vagrant file can spin up the following types of VMs
- master: K8s Control Plane
- worker: Run business workloads ( taint
k8s.prada.io/workload=app:NoSchedule
) - storage: runs Longhorn
- infra: runs in-cluster utilities like Metallb, CertManager, Traefik, Longhorn, ...
You can modify the number of each type of VMs (except master) that you would like to bring up.
No CNI plugin is installed. Cilium
will be used as the CNI Network Plugin. It can be configured later using the CLI.
** This is since cilium requires all nodes in a k8s cluster to be available and we did not go the route of running a post processor in Vagrant.
- Working Vagrant setup
- 16 Gig + RAM workstation with 8+ cores and 20GB+ storage
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
To provision the cluster, execute the following commands.
vagrant up
cd configs
export KUBECONFIG=$(pwd)/config
or you can copy the config file to .kube directory.
cp configs/config ~/.kube/
vagrant halt
vagrant up
vagrant destroy -f
To provision the cluster with Metallb, Longhorn, Kube Prometheus Stack, Traefik, Certmanager, .. please follow the instructions here