DEV Community

Jayanth Dasari
Jayanth Dasari

Posted on

Day-24: Demystifying Kubernetes β€” Why We Need It & How It Works 🚒

Moving from Docker to Container Orchestration: A deep dive into the Control Plane and Data Plane.
Today, I took a massive step forward in my DevOps journey. After getting comfortable with Docker and containerization, I realized something: running a few containers is easy, but managing hundreds of them across different servers? That is a nightmare waiting to happen.

Enter Kubernetes (K8s).

Today, I spent my time learning why Kubernetes exists and breaking down its complex architecture. Here is what I learned about the "Brain" (Control Plane) and the "Muscle" (Data Plane) of K8s.

  1. Why Kubernetes? (The Problem with Just Docker) Before diving into the architecture, I had to answer one question: Why can't I just use Docker?

If you are running a simple app on your laptop, Docker is fine. But in a production environment, you run into issues:

Scalability: How do you increase the number of containers automatically when traffic spikes?

High Availability: What happens if a container (or the server it is on) crashes? Who restarts it?

Communication: How do all these containers talk to each other securely?

Kubernetes is a Container Orchestration tool. It automates the deployment, scaling, and management of containerized applications. If Docker is a single musician, Kubernetes is the conductor of the entire orchestra.

  1. The Kubernetes Architecture: A High-Level View Kubernetes follows a Client-Server architecture. It is essentially a cluster composed of two main categories of machines:

The Control Plane (Master Node): The decision-maker. It manages the cluster.

The Data Plane (Worker Nodes): The workforce. This is where the actual applications (containers) run.

Let's break down the components of each.

  1. The Control Plane (The Brain) The Control Plane is responsible for maintaining the "desired state" of the cluster. If I tell Kubernetes, "I want 3 copies of my app running," the Control Plane ensures that happens.

It consists of four main components:

A. Kube-API Server (The Gatekeeper)
This is the front door to the Kubernetes cluster.

Whenever we run a command (like kubectl), the request goes to the API Server first.

It validates requests and authenticates users.

B. etcd (The Memory)
This is a highly available key-value store (database).

It stores the entire cluster data: configuration, secrets, and the state of every node and pod.

It is the "backing store" for all cluster data.

C. Kube-Scheduler (The Planner)
The scheduler watches for newly created Pods that have no Node assigned.

It decides which worker node the Pod should run on based on resources (CPU/RAM) and constraints.

D. Kube-Controller Manager (The Enforcer)
This runs controller processes in the background.

It creates a loop that constantly compares the current state of the cluster to the desired state.

Example: If a Node goes down, the Controller Manager notices and triggers the creation of new Pods elsewhere.

  1. The Data Plane (The Muscle) The Data Plane consists of the Worker Nodes. This is where the actual work happens. Each Node contains three vital components:

A. Kubelet (The Captain)
An agent that runs on every node in the cluster.

It listens to instructions from the API Server (Control Plane) and ensures the containers are running and healthy inside the Pods.

B. Kube-Proxy (The Networker)
It maintains network rules on the nodes.

It handles all the networking magic that allows Pods to communicate with each other and the outside world.

C. Container Runtime (The Engine)
This is the software responsible for actually running the containers.

While Docker is the most famous one, Kubernetes supports others like containerd and CRI-O.
Linkedin: https://www.linkedin.com/in/dasari-jayanth-b32ab9367/

Top comments (0)