
Deploy a production-grade Kubernetes cluster on your local machine with a single command!
This post will demonstrate how to launch a local k8s development environment leveraging k3s.
K3s is a lightweight production-grade Certified Kubernetes distribution. More info. can be found at https://k3s.io/.
Prerequisites To Deploying Local Dev Environment
- Vagrant (tested with 2.1.2)
- VirtualBox (tested with 5.2.30)
- Vagrantfile (clone my GitHub repo, found here)
Vagrant Up!
After satisfying prerequisites navigate to directory containing Vagrantfile and issue “vagrant up”. After a few minutes you should have a three node cluster up and running! The k8s cluster is configured to leverage Flannel for networking, etcd to store data and should be similar to the below diagram.

kubectl
from localhost copy k3s.yaml
contents to ~/.kube/config
(k3s.yaml copied to local vagrant directory)
C:\>kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
master Ready master 17m v1.14.4-k3s.1 192.168.0.200 <none> Ubuntu 18.04.2 LTS 4.15.0-54-generic containerd://1.2.7-k3s1
node1 Ready worker 15m v1.14.4-k3s.1 192.168.0.201 <none> Ubuntu 18.04.2 LTS 4.15.0-54-generic containerd://1.2.7-k3s1
node2 Ready worker 13m v1.14.4-k3s.1 192.168.0.202 <none> Ubuntu 18.04.2 LTS 4.15.0-54-generic containerd://1.2.7-k3s1
C:\>kubectl get componentstatus
NAME STATUS MESSAGE ERROR
scheduler Healthy ok
controller-manager Healthy ok
etcd-0 Healthy {"health": "true"}