Installing Kubernetes with kubeadm

If you really want to learn Kubernetes, one of the best things you can do is build a Cluster from scratch at least once.

Instead of starting with a managed service where everything is already prepared for you, setting up your own Cluster helps you understand what is actually happening behind the scenes.

In this video, we build a Kubernetes Cluster using kubeadm and go through the installation step by step.

What Is kubeadm?

kubeadm is one of the official Kubernetes tools for bootstrapping a Cluster.

We can use it to initialize the Control Plane and then join Worker Nodes to our Cluster.

The nice thing about kubeadm is that it handles many of the complicated parts of the installation without hiding everything from us.

That's why it's also a great way to learn how a Kubernetes Cluster is actually built.

What Do We Need Before Installation?

Before creating the Cluster, we need to prepare our Nodes.

We check things like hostnames, networking, Swap, and other operating system requirements.

Then we install the main Kubernetes tools:

kubelet

kubeadm

kubectl

We also need a Container Runtime so our Containers can actually run on the Nodes.

Setting Up the Control Plane

Once our servers are ready, we start with the Control Plane.

Using kubeadm init, we initialize the first Node and create the basic Kubernetes Cluster.

After that, we configure kubectl so we can communicate with the Cluster from the command line.

Now we can start checking our Nodes, Pods, and other Kubernetes resources.

At this point, our Cluster is finally starting to come alive!

Adding Worker Nodes

A Control Plane alone isn't enough for what we want to build.

We also need to add our Worker Nodes.

After running kubeadm init, we get a command that can be used to join other Nodes to the Cluster.

We run that command on our Workers, and they become part of the Kubernetes Cluster.

Finally, we can check everything with:

kubectl get nodes

Seeing all your Nodes show up there after going through the whole setup is always a nice moment! 😄

Kubernetes Networking

Another important part of the installation is networking between Pods.

For this, we need to install a CNI Plugin in our Cluster.

The CNI provides the networking required for Pods to communicate, including Pods running on different Nodes.

So even if kubeadm init completes successfully, our setup isn't really finished until the Cluster networking is properly configured.

What Do We Have in the End?

After completing these steps, we have a working Kubernetes Cluster with a Control Plane and Worker Nodes ready to run our workloads.

But the main goal of this video isn't just to copy and paste a few commands.

The important part is understanding why we're running those commands and how the different pieces come together to create a Kubernetes Cluster.

In this video, we go through the Kubernetes installation with kubeadm from preparing the Nodes and initializing the Control Plane to configuring networking and joining Worker Nodes.

If you're serious about learning Kubernetes, I think building a Cluster from scratch at least once is definitely worth it.

And if you break it the first time, that's fine. You'll probably learn more from fixing it anyway! 😄