How to set up Kubernetes (K3s) cluster on two machines
2023-01-17 0:52:42
Kubernetes are very useful for managing servers at a scale. Someone might ask, I don't have more than 3 servers to manage. Should I go for Kubernetes, or could we use Docker or Docker Compose?
In the past several years, I would suggest we could just use Docker Compose. But seeing that more mature and lightweight Kubernetes solutions appeared, I changed my mind and started using Kubernetes if I had more than two machines to manage (or even one machine). I think K3s is a good distribution of Kubernetes which has a relatively small footprint in case you have a small cluster. Comparing it to running the container naked using Docker compose, using K3s will require you to run a few extra Kubernetes administrative processes. That is about 150 MB of extra memory, which should not be a big deal for most IoT devices (I guess).
We are using Kubernetes not just for managing a "huge" cluster but to have verifiable deployment across development and deployment. In our development environment, we downscale the cluster to 1. And in the production or staging environment, we could upscale the deployment if necessary.
This article will describe how to install a light weighted version of Kubernetes -- K3s in two nodes and with IPv6 enabled.