DEV Community

Cover image for Kubernetes Architecture Explained: The core components that run your cluster
<dotman/>
<dotman/>

Posted on

Kubernetes Architecture Explained: The core components that run your cluster

You have containerized your application with Docker and you need to run 100 copies across 20 servers, restart the containers when they crash, scale up or increase resources at users spike, plan updates without downtimes, doing that by hand(manually) is chaotic, that’s where kubernetes comes in.

Requirements

You’ll also want at least 2 CPUs, 2 GB of free RAM and 20 GB of free disk space, plus a decent internet connection for the first start, since Minikube downloads its images then.

Once installed, confirm everything is ready:


docker - version
minikube version
kubectl version - client
Enter fullscreen mode Exit fullscreen mode

What is Kubernetes

Kubernetes also known as k8s is an open-source software used in managing software application containers anywhere automatically. The management includes service discovery, load balancing, safe updates(rollouts and rollbacks), self healing, secret management. K8s takes care of these tasks automatically so your application stays online, secure and up to date with minimal manual intervention.

Core components of Kubernetes architecture

For kubernetes to perform the way it does, a cluster is split into two major parts: the control place and the worker nodes.

  • The control plane: The control plane manages the overall state of the cluster. They make global decisions about the cluster, detecting and responding to cluster events.
  • Worker node: Node components run on every node, maintain every pod, and provide the Kubernetes runtime environment. This is where your underlying applications actually run, processing workloads and handling the data traffic directed to your containers.

How they work together

Here is a simple diagram that provides a high-level overview of the essential components that make up a Kubernetes cluster

Control plane components

  • kube-apiserver: this is the core component server and called the API server. It exposes the kubernetes HTTP API. It is the frontend for the kubernetes control plane.
  • etcd: this is a highly available and consistent key-value store for all cluster data.
  • kube-scheduler: this looks for pods that are not yet bound to a node and assigns the pod to a suitable node.
  • kube-controller-manager:runs the controller to implement k8s API behaviour

Worker node components

This includes:

  • kubelet: They ensure the pods are running, also their containers
  • kube-proxy: maintains network rules on nodes to implement services
  • container runtime: they run the containers, manage the execution and lifecycle of containers within the Kubernetes environment.

See the components in action

You don’t need a cloud account to explore these components. Tools like minikube or kind let you run a kubernetes cluster on your own laptop. For this walkthrough, we would use minikube.

After installing the necessary requirements

  1. Start a cluster
minikube start
Enter fullscreen mode Exit fullscreen mode

This command creates a single-node cluster where one machine plays the role of both the controller plane and the worker node.

  1. Check your nodes
kubectl get nodes -o wide
Enter fullscreen mode Exit fullscreen mode

This is what your result would look like:

NAME       STATUS   ROLES           AGE   VERSION   ...   CONTAINER-RUNTIME
minikube   Ready    control-plane   2m    v1.31.0   ...   docker://27.2.0
Enter fullscreen mode Exit fullscreen mode

You would notice the ROLES column shows the node is running in the control plane. The STATUS as Ready means the kubelet on this node is healthy and reporting back to the API server. The CONTAINER-RUNTIME column shows which runtime is actually running your containers.

  1. Look inside the kube-system namespace
kubectl get pods -n kube-system
Enter fullscreen mode Exit fullscreen mode

Result:

NAME                               READY   STATUS    RESTARTS   AGE
coredns-6f6b679f8f-x7k2p           1/1     Running   0          3m
etcd-minikube                      1/1     Running   0          3m
kube-apiserver-minikube            1/1     Running   0          3m
kube-controller-manager-minikube   1/1     Running   0          3m
kube-proxy-9zq4m                   1/1     Running   0          3m
kube-scheduler-minikube            1/1     Running   0          3m
storage-provisioner                1/1     Running   0          3m
Enter fullscreen mode Exit fullscreen mode

The components we discussed earlier are running as pods inside the cluster itself: kube-apiserver-minikube, etcd-minikube, kube-scheduler-minikube and kube-controller-manager-minikube are the control plane components. kube-proxy-9zq4m is the worker node networking component. It runs on every node in the cluster.

coredns is an add-on that provides DNS so services can find eachother by name. It is not a core component, but you will see it in almost every cluster.

Also note you won’t find the container runtime and the kubelet in that list, it is intentional. The kubelet is the component that starts the pods, so it won’t run as a pod itself. It runs directly on the node as a system service. You can confirm this:

minikube ssh
sudo systemctl status kubectl
Enter fullscreen mode Exit fullscreen mode

You would see the kubelet as active(running). You can type exit to leave the node.

Common misconceptions about Kubernetes

  • “Kubernetes runs my containers” — Kubernetes ochestrates containers, it decides where they should run, how many should exist, and what to do when a container fails. The actual running of the container is done by the container runtime in each worker node. Kubernetes gives the instructions; the runtime does the work.
  • “The components talk to each other directly” — They don’t. The API server is the central hub for everything. Everything goes through the server first: individual components communicate exclusively with it, while other services constantly watch the API server for changes, pulling down the specific updates they care about.
  • “etcd is where I store my application’s data” — etcd stores the cluster’s data: what pods exist, what deployment look like, configguration and state. It is not a general purpopse database for your application. You application’s data belongs in a proper database like PostgresSQL or MongoDB, running inside or outside the cluster.

Recap

Kubernetes can feel overwhelming at first, but its architecture comes down to a simple division of labour:

  • The control plane decides. The API server is the front door for every request, etcd stores the cluster’s state, the scheduler assigns pods to nodes, and the controller manager keeps checking that what’s running matches what you asked for.
  • The worker nodes execute. The kubelet makes sure pods and their containers are running, kube-proxy handles networking so traffic reaches the right pods, and the container runtime actually runs the containers.
  • Everything flows through the API server. No component works in isolation; they all coordinate through this single hub.

Now that you understand the core components of the kubernetes cluster, the next step is learning what the cluster manages.

You should look into the three objects you’ll use most as a Kubernetes user:

  • Pods
  • Deployment
  • Services

Top comments (0)