If you are familiar with Kubernetes, you must know Kubernetes installation is one of the challenging topics. This challenge occurs because a multitude of installation methods exists. I intend to introduce Kubernetes installation methods, available choices, and best practices in this article. Let’s get started.

Follow our social media:

https://www.linkedin.com/in/ssbostan

https://www.linkedin.com/company/kubedemy

https://www.youtube.com/@kubedemy

https://telegram.me/kubedemy

Kubernetes Installation Methods:

Because many installation methods exist, I divide these methods into five major types. This division is based on usage, ease of installation, and where to install.

1- Single-node installation:

This type of installation is suitable for those who want to preview Kubernetes or for practices, tests and development purposes. Many single-node Kubernetes distributions are on the market, but I introduce the most popular ones.

minikube is a single-node Kubernetes distribution that releases officially by the Kubernetes community. The latest version of Kubernetes can be run with minikube. Alongside installing Kubernetes, some Kubernetes addons can be run quickly. With minikube, Kubernetes can be deployed on VM, Container, or bare-metal systems. Multiple container runtimes (Docker, Containerd, CRI-O) are supported in minikube.

More on https://minikube.sigs.k8s.io

kind is a Kubernetes distribution to run clusters inside Docker containers. Kind stands for Kubernetes in Docker. This distribution is suitable for testing, local development and CI systems. kind is distributed officially by the Kubernetes community.

More on https://kind.sigs.k8s.io

k3s is another functional distribution released by Rancher. It was initially built for IoT and edge computing but can be used for other purposes. You can run a single-node Kubernetes or a cluster with several commands.

More on https://k3s.io

k3d is a wrapper for running k3s on Docker. It launches a Kubernetes cluster on your local machine, just like Kind. k3d is released by Rancher.

More on https://github.com/rancher/k3d

microk8s is another installation option. A single-node Kubernetes and clusters can be deployed using microk8s. Canonical releases this Kubernetes distribution – the company releases Ubuntu – and it’s also available on the Snappy package manager. Kubernetes can be deployed with a couple of commands using microk8s. Alongside Kubernetes, a set of various addons are available so that they can be deployed quickly.

More on https://microk8s.io

2- Manual cluster installation:

This type of installation is used for deploying a minimum viable cluster. Some parts of the installation should be done manually. It’s a preferred way to deploy the Kubernetes cluster for the first time.

kubeadm is a tool used to deploy a cluster manually. It is used to bootstrap Kubernetes components, not provisioning machines. Before bootstrapping the cluster, some actions should be done manually.

More on https://kubernetes.io/docs/reference/setup-tools/kubeadm

3- Automatic cluster installation:

This installation type uses automation tools, scripts, or provider-distributed installers. It’s a preferred way for those who want to deploy production-grade Kubernetes clusters on both an on-premises environment and the cloud with more control over all Kubernetes components, both Control-plane and worker nodes.

kubespray is a collection of Ansible playbooks used to deploy production-grade clusters on both bare-metal systems and the cloud. Alongside the installation, day two operations can be performed using kubespray. The Kubernetes community officially maintains this installer. A dozen addons are available in kubespray and can be deployed along with Kubernetes quickly. kubespray is one of the most suitable installation choices.

More on https://github.com/kubernetes-sigs/kubespray

kops will manage the cluster lifecycle and provide necessary cloud infrastructure. Deploying on AWS is supported officially; deploying on other cloud providers is available but in alpha and beta state.

More on https://kops.sigs.k8s.io

RKE is a Rancher distributed Kubernetes which deploys production-grade Kubernetes clusters on top of Docker containers. RKE is easy to manage Kubernetes distribution. Select this distribution if you want to use the Rancher Kubernetes Management platform.

More on https://github.com/rancher/rke

Charmed Kubernetes is the Canonical way to deploy Kubernetes clusters with Juju. It’s suitable for running Kubernetes both on Multi-cloud environments and bare-metal. If you are looking for an eligible Kubernetes distribution that can be deployed on OpenStack, this installer is designed for you.

More on https://ubuntu.com/kubernetes

KubeSphere is not only a Kubernetes distribution but also a platform for creating a cloud solution based on Kubernetes. Many tools, addons, etc., can be deployed using KubeSphere along with Kubernetes. This platform can also be deployed on the existing Kubernetes cluster to manage it using KubeSphere.

More on https://kubesphere.io

Kubermatic is a Kubernetes platform, just like Rancher. You can deploy and manage Kubernetes clusters on cloud as well as on-premises. OpenVPN handles the connection between the master/seed cluster and the downstream clusters.

More on https://github.com/kubermatic/kubermatic

KubeOne is a tool to provision necessary infrastructure and deploy Kubernetes on several providers. It can be integrated with Terraform and Kubermatic.

More on https://github.com/kubermatic/kubeone

4- Managed clusters:

The cloud providers manage the lifecycle of your clusters. In this type of installation, a production-grade cluster can be deployed with minimum user effort. Providers are responsible for managing the whole cluster and the underlying infrastructure. This method is suggested to anyone because of its ease of installation and management. Another benefit of using managed Kubernetes is access to cloud features. Some managed Kubernetes providers provide a set of useful features which may not be available on on-premises or bare-metal solutions.

Magnum is an OpenStack solution for installing managed Kubernetes – and other orchestration tools – on top of the OpenStack ecosystem. With Magnum, cloud customers can run Kubernetes clusters quickly. I decided to introduce it here because it also supports fantastic cloud features. In addition, OpenStack-based cloud providers can provide this method to their customers to install managed Kubernetes clusters.

More on https://docs.openstack.org/magnum/latest

EKS stands for Elastic Kubernetes Service and is the Amazon solution to provide managed Kubernetes clusters. EKS can easily be integrated with other Amazon services. A command-line tool, eksctl, runs a production Kubernetes cluster in a few minutes.

More on https://aws.amazon.com/eks

GKE is a Google version of Kubernetes, just like EKS. GKE also offers a special operation mode called Autopilot which reduces managing costs and optimizes clusters.

More on https://cloud.google.com/kubernetes-engine

AKS is managed by Microsoft Azure and can be deployed quickly. This managed Kubernetes solution is suitable for Azure users because it integrates with other Azure tools available in the Azure ecosystem.

More on https://azure.microsoft.com/en-us/services/kubernetes-service

5- Kubernetes the hard way:

The hard way method is used to install Kubernetes from scratch. I suggest this type of installation to everyone who wants to learn all components of Kubernetes to understand Kubernetes deeply. If you want to know the process of deploying a cluster and what happens behind the sense between cluster components, install Kubernetes with this method at least once.

Kelsey Hightower is the one who released the hard way method for the first time, as far as I know. He explains how to deploy Kubernetes from scratch on GCP.

More on https://github.com/kelseyhightower/kubernetes-the-hard-way

Mumshad Mannambeth forked Kelsey’s repo and changed that to deploy to local VMs using HashiCorp Vagrant. Even though this version of the hard way is not updated to the latest Kubernetes version, it’s an excellent way to start.

More on https://github.com/mmumshad/kubernetes-the-hard-way

Conclusion:

Many other tools and solutions for installing Kubernetes exist on the market; however, I described more popular ones. Which method you should use is up to you. There is no absolute right solution, but if you want my opinion as best practice, here are some options for you in different situations.

Absolute single-node for testing and development: minikube

Running a multi-node Kubernetes on a single-node machine: Kind or k3d

Minimal production cluster based on Ubuntu ecosystem: microk8s

A single-node with pre-installed addons: k3s

IoT friendly with clustering support: k3s or microk8s

For use as executor on CI/CD systems: k3s or microk8s

Manual minimum viable cluster: kubeadm

Automated cluster installation based on Ansible: kubespray

Self-managed cluster on AWS: kops

Self-managed for various infrastructures: KubeOne

Rancher-friendly cluster on top of Docker: RKE

For Ubuntu lovers that use Juju: Charmed Kubernetes

Managing Multi-cluster environments: Rancher or Kubermatic

Cloud-native application management: KubeSphere

Clouds that are based on OpenStack: Magnum

Managed cluster for everyone: GKE, EKS or AKS

Managed cluster with Autopilot support: GKE

For who one needs to understand Kubernetes deeply: The Hard Way

Day to day practices(all-in-one): minikube or k3s

Please comment below if you have some experience or know other suitable methods. I will update this post if any changes happen in the market.

Follow my LinkedIn https://www.linkedin.com/in/ssbostan

Follow Kubedemy LinkedIn https://www.linkedin.com/company/kubedemy

Follow Kubedemy Telegram https://telegram.me/kubedemy

Leave a Reply

Your email address will not be published. Required fields are marked *