Setting up Kubernetes using Vagrant, Ansible and VirtualBox without knowing anything about Vagrant and Ansible
This project is dedicated to users who have no experience with Ansible. Therefore, I have avoided the use of roles and dependencies in order to reduce the complexity from a beginner's point of view.
Special thanks go to Javier from IT Wonder Lab, whose work and explanations are partly the basis for this project. Please check out his great tutorial and the corresponding repository on this topic.
The following requirements are considered to be given:
- *nix
- Python 3
- Vagrant
- VirtualBox
- kubectl
Clone the code like this:
git clone https://github.com/grothesk/kubernetes-vagrant-for-dummies.git
Create a venv like this:
python3 -m venv venv
Activate the venv like this:
source venv/bin/activate
Installing Ansible via the requirements.txt goes like this:
pip install -r requirements.txt
Configure the file according to the available system resources. Run vagrant from the vagrant directory:
vagrant up
Change to the base folder of this project and configure kubectl to make use of the created kubeconfig file:
export KUBECONFIG="$(pwd)/kubeconfig"
Do not forget to unset KUBECONFIG when you are done!
Check the status of the cluster nodes like this:
kubectl get nodes
Change to the vagrant folder and shutdown the nodes like this:
vagrant halt
You can remove the VMs like this:
vagrant destroy