A completely Dockerized multi-node Kubernetes highly-available cluster provisioned using Vagrant/Ansible, based on Kubernetes version 1.12 (still not enough fancy words for a day 😃)
Note: This is not a production-ready setup. Instead, this is intended to be a base/idea for one (if looking for custom setups, otherwise Kubeadm does job pretty well).
-
The setup uses multi-master and multi-worker setup (and multi-etcd, of course).
-
On the master-node side, everything is ordinary, as you would expect from any regular Kubernetes master.
-
On the worker-node side, the master-nodes are loadbalanced using HAProxy. So the Kubelet connects to HAProxy's address instead of a specific master.
-
Yes, HAProxy runs on each of the worker-nodes instead of master. This is because if the master goes down, it also takes down loadbalancer with it (not an ideal scenario).
-
CNI: Weave Net
-
DNS: Core DNS
-
Vagrant is simply a convenient way of automatically spinning up a cluster. You can easily configure the instances in
Vagrantfile
. -
Uses Virtualbox.
-
Default instance-count:
ETCD: 1
Kube-Master: 1
Kube-Worker: 2
-
The setup is based on a custom packed CoreOS based Vagrant-image. Image-source: Jaskaranbir/packer_coreos-ansible-python
-
Just run
vagarnt up
, and it will automatically run install/run Ansible and setup a local Kubernetes cluster.
- HAProxy hosts are not dynamic, need to manully add to config and restart HAProxy.
- Improve Security. Suggestions welcomed.
-
When adding/removing instances, be sure to also update the Ansible inventory.
-
Ansible copies its templates for manifests/configs to
/etc/kubernetes
, which will contain all Kubernetes resources, including certificates.