Create a Kubernetes cluster with Vagrant and VirtualBox.
This is meant as a cost-free alternative to the excellent tutorial Kubernetes The Hard Way, while being slightly more real than Minikube.
Last tested with:
- Vagrant 2.2.2
- VirtualBox 5.2.22
- kubectl 1.12
Choose one of the OS directories.
The Vagrantfile
can be used to start VMs for a Kubernetes cluster:
- One master,
k8s-master
- Two workers,
k8s-worker-0
andk8s-worker-1
vagrant up
./cluster-up.sh
cp -i config ~/.kube/
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 48s v1.9.1
k8s-worker-0 Ready <none> 29s v1.9.1
k8s-worker-1 Ready <none> 23s v1.9.1
Then perform some smoke tests like using your local kubectl
to run a container as done here:
https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/13-smoke-test.md
vagrant destroy -f