Quantcast
Channel: tech cottage
Viewing all articles
Browse latest Browse all 48

Multi master kubernetes on containerd with haproxy/nginx/envoy load balancer

$
0
0

Kubernetes has declared that it is going to remove support for docker as runtime.  Its has deprecated docker as runtime post v1.20.  Complete removal of docker as runtime is planned for the 1.22 release in late 2021.

Kubernetes had been using docker to get to containerd(which is what it actually needs) via dockershim. 

This post shows how to create a kubernetes cluster on containerd via a simple menu driven script. The script has been verified to work with debian 10, ubuntu 16.04, 18.04 and 20.04.

For the multi-master case, it also provides the choice of haproxy/nginx/envoy as load balancer to front the kube api servers.

Requirements: A bunch of machines with root ssh access from where the provisioning script is run.

For demo purpose, it uses 4 compute engine instances - 1 for load balancer, 2 master nodes and 1 worker node.







Checkout the following git repository:

git clone https://github.com/ratulb/k8s-easy-install

And launch the script cluster.sh

cd k8s-easy-install && ./cluster.sh



User would be presented with a menu as shown below:









Next, select option 5 and enter the load balancer details:
















Next,  provide the master nodes'  and worker node's addresses and trigger launch.









Next, in a couple of minutes - we see cluster setup in progress - followed by completion of setup.




















Disclaimer:

At it's core this script is very dumb  - it does what it is told to do - it has no recollection at all. If told these are the masters - it will act so. Next time, if the masters are given as workers - it will carry out the steps to make them behave as workers. It will not check that it is destroying a running cluster.  Obeys the kubernetes philosophy - everything is cattle - no pets. That said, the whole thing is evolving - its only part of a project that is on foot currently . That's for another post on another day.

At present, it does some checks though - input mistakes like machine appearing both as worker as well as master or load balancer collocated(no valid reason for this scenario) - with master or a worker - and load balancer port still being 6443. 









Viewing all articles
Browse latest Browse all 48

Trending Articles