Kubernetes for Beginners: An Overview

Kubernetes for Beginners: An Overview

What is Kubernetes?

Kubernetes originates from the Greek word for pilot or helmsman. Kubernetes is an orchestration tool, so it makes sense that it originally meant helmsman (a person that steers a ship). Kubernetes, also known as K8s, is an open-source container orchestration tool that can automate deployments, scale, and manage containerized applications. Following the widespread adoption of containerization as opposed to the traditional way of deploying on bare metal virtual machines and servers, the need to manage these containers increased, as containers are ephemeral and require more administrative efforts.

Containers

As Docker defines it, a container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A container is a running instance of an image.
To run a container, we need a container runtime engine such as Docker, Containerd, and this forms one of the crucial components of a Kubernetes Cluster.

The Kubernetes Architecture

Kubernetes comprises nodes that make up a cluster. This cluster contains all the nodes that are to handle the container workload. There are two types of nodes in a Kubernetes Cluster: the control plane/master node(s) and the worker node(s).

The control plane (kube-apiserver, etcd, kube-controller-manager, kube-scheduler) and several nodes. Each node is running a kubelet and kube-proxy.

Picture credit: Kubernetes docs

Control Plane Component

The control plane is the helmsman. A Kubernetes cluster is made of master node(s) that are actually responsible for container orchestration. This is possible with the aid of the control plane components:

API server: The API server exposes the Kubernetes API, and we are able to communicate with the Kubernetes cluster because of the API server. The kubectl CLI tool helps to access the Kube API server.

etcd: This is a key-value store of the cluster data. etcd is used by Kubernetes to store configurations and the state of every resource on the cluster.

Controller manager: For each of the various processes and resources run by Kubernetes, the controller managers manage these processes. An example is the replication controller that is responsible for ensuring the number of replicas of a container match the configuration.

Kube scheduler: This is responsible for scheduling pods on available nodes based on pre-configured criteria for making such decisions, such as node affinity, taints, and tolerations on the node.

Oops, we have not said what a pod is, right?

A pod is the smallest unit of a Kubernetes application, it comprises at least one container, and in the case where there are multiple containers in a pod, they can reach each other using localhost.

It is often considered best practice to keep an odd number of master nodes: 3, 5, 7, and so on. While it is possible to have a single-node cluster where the master node is also the worker node, it is safer to keep workloads off the master node for high availability.

The worker node

As the name implies, the workload and containerized applications managed by Kubernetes run on the worker node, and a typical worker node must have the following components:

Container Runtime: The container runtime engine helps to run containers, with examples like Docker and containerd. As of today, dockershim is no longer supported as a container runtime for Kubernetes.

Kubelet: This is different from the scheduler of the control plane. The kubelet ensures that containers are running in the pod exactly as specified in the configuration. Static pods are managed directly by the kubelet on a node and are not managed through the Kubernetes API server.

Kube-proxy: Pods/containers are ephemeral, which introduces challenges with IP address management and pod identification in the cluster. The kube-proxy manages network rules on nodes.

Benefits of Kubernetes

According to CNCF Annual Survey 2023, 84% of cloud consumers have adopted Kubernetes with 66% of them using Kubernetes in production. So what are the benefits of this Kubernetes that everyone now wants to adopt?

  • Self-Healing capabilities of workload

  • Service Discovery and Load Balancing

  • Automatic Deployment and Rollout

  • GitOps and Ease of Continuous Deployment

  • Robust API objects for managing applications

Want to learn more about Kubernetes, check out their documentation here

Conclusion

Kubernetes has transformed how we manage containerized applications, offering a solution for deploying and scaling software across various cloud environments. Cloud providers like Azure and AWS provide managed Kubernetes such as AKS (Azure Kubernetes Service), EKS (Elastic Kubernetes Service), and DOKS (DigitalOcean Kubernetes Service). As cloud technologies continue to evolve, Kubernetes remains at the forefront of modern software infrastructure and container orchestration.


If you're a cloud beginner, an enthusiast, or even a professional looking to expand your knowledge of the cloud, you can subscribe to our newsletter! It's the perfect place to kickstart your cloud journey.