How to Install a Kubernetes Cluster
Kubernetes cluster setup can be a tricky task to complete. Most people use a single cluster setup with minicube on a local server in a learning environment. When it comes to production-grade installation and configuration, things get more complicated and most organizations get help from IT Giants to have managed Kubernetes clusters but all come with a cost and not a neglectable one. I wanted to share my thoughts on how to set up a production-grade Kubernetes cluster in a lab environment for learning purposes.
I am not trying to cover all aspects of a production K8s cluster installation and configuration as I am also learning while I am writing the post :) I will just share my thoughts on how it should look like and I am more than happy to hear your feedback.
We can summarize K8s cluster installation into 6 steps. I would like to go deeper with all the steps in the upcoming posts and will automate each step by writing Ansible roles.
- 1.Prerequisites (firewalls, selinux, swap space, etc)
- 2.Installing container runtime interface
- 3.Installing kubeadm, kubelet and kubectl
- 4.Initialize master server
- 5.Installing Container network interface
- 6.Joining worker and other control plain nodes
As you can see above, we can have multiple selections for each step as we have more than one CRI and CNI providers. I will mention how to structure each step and give freedom to users with Ansible roles in the upcoming posts series. Finally, I will wrap up the discussion by providing an example play to install and configure a Kubernetes cluster from scratch.