Kubernetes - What It Is, What It's For and Core Concepts
1. The Problem Kubernetes Solves
Running a standalone container by hand with docker run solves the problem of packaging and distributing an application quite well. But as soon as that application needs to run in production — with multiple replicas, fault tolerance, zero-downtime updates and scaling with demand — the “loose container” becomes a manual management problem: who restarts a container that crashed? Who spreads the load across several instances? Who decides which machine each container runs on when there are dozens of servers available? Homemade docker run scripts and a cron job checking whether the process is still alive work for a while, but they don’t scale beyond a handful of services.
Kubernetes (sometimes abbreviated as k8s) is a container orchestrator: a system that receives a description of “what” should be running (how many replicas, how much CPU/memory, which ports to expose) and takes care of the “how” — it decides which machine each container runs on, restarts whatever fails, distributes traffic across healthy replicas and automatically reschedules containers if an entire server goes down. This is the first part of a series that goes from zero to advanced Kubernetes and GitOps: today the focus is understanding the problem Kubernetes solves and the core concepts that underpin everything that comes next.
2. Loose Containers and VMs vs Orchestration
Compared to running “loose” containers (one docker run per server, managed by hand or by scripts), Kubernetes automates precisely what becomes impossible to do manually at scale:
- Self-healing: if a container hangs or the process dies, Kubernetes detects it and starts a new one automatically — without human intervention and, ideally, without any noticeable impact for the application’s users.
- Scaling: going from 2 to 10 replicas of an application is a configuration change (or an automatic one, based on usage metrics), not a manual process of logging into servers and running commands one by one.
- Load distribution: Kubernetes decides which machine (
node) each container runs on, taking available resources into account, and automatically distributes traffic across a service’s healthy replicas. - Zero-downtime updates: changing an application’s version can be done by replacing replicas gradually (rolling update), keeping the service up throughout the process.
Compared to manually managed virtual machines (one application per VM, scaled by creating more VMs), the gain is similar to what containers already bring over VMs on their own: much higher density (several applications sharing the same physical servers with proper isolation) and startup in seconds instead of minutes — but now with a system that automatically decides where each workload runs, instead of someone manually picking which VM each application goes on.
This doesn’t mean every application needs Kubernetes — a small system, with one or two services and little need to scale, can live perfectly well with a well-configured docker run or Docker Compose (see this blog’s Docker series). Kubernetes is worth the effort when the number of services, the need for high availability or the variation in load make manual management unfeasible.
3. Core Concepts: Pods, Deployments and Services
Kubernetes organizes everything around objects described declaratively (usually in YAML), which tell the cluster the desired state. Three of them show up in practically every application:
- Pod: the smallest unit Kubernetes manages directly. A Pod contains one or more containers that share network and storage — in practice, the vast majority of Pods have exactly one container, with additional containers reserved for specific cases (like a “sidecar” that collects logs). Pods are ephemeral: when a Pod dies, it isn’t “recreated” in the sense of bringing the same Pod back to life — a new Pod is created from scratch in its place.
- Deployment: describes how many replicas of a Pod should exist and how to update them. It’s the Deployment that ensures that, if a Pod dies, another one takes its place automatically, and that manages rolling updates when an image version changes.
- Service: since Pods are ephemeral and get a new IP every time they’re recreated, you can’t reliably point directly at a Pod’s IP. A Service solves this by exposing a stable address (internal DNS name and fixed IP inside the cluster) that distributes traffic across every healthy Pod matching a given
label— regardless of how many Pods exist or whether they’ve been recreated.
Deployment "api"
├── guarantees 3 replicas of the Pod
├── Pod (replica 1) ── container: api:1.2
├── Pod (replica 2) ── container: api:1.2
└── Pod (replica 3) ── container: api:1.2
Service "api" (stable IP, internal DNS "api")
└── distributes traffic across the 3 Pod replicas above
This relationship — a Deployment guaranteeing Pod replicas, a Service exposing a stable address for them — is the foundation on which practically all the rest of Kubernetes (ConfigMaps, Secrets, Ingress, volumes, and the GitOps concepts discussed later in this series) rests.
4. Experimenting Locally with Minikube or Kind
You don’t need a production cluster to start learning Kubernetes. Two popular tools create a complete cluster running locally, inside Docker or a lightweight VM:
# Minikube — creates a local cluster in a VM/container
minikube start
# Kind (Kubernetes in Docker) — creates the whole cluster inside Docker containers
kind create cluster
Both result in a working cluster accessible through kubectl (Kubernetes’ official CLI, the full subject of the next article in this series). To confirm the cluster is up:
kubectl cluster-info
kubectl get nodes
The second command lists the nodes (machines, real or virtual, that make up the cluster) — in a local cluster, usually just one node acting as both control plane and worker.
5. A First Deploy in Practice
With the local cluster up, a minimal Deployment already illustrates the three concepts above. In a file called nginx-deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.27
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 80
type: ClusterIP
Applying it to the cluster:
kubectl apply -f nginx-deployment.yaml
kubectl get pods
kubectl get deployments
kubectl get services
The first command (kubectl apply) is the declarative way of working with Kubernetes: instead of saying step by step what to do, you describe the desired state (three Nginx replicas, exposed by a Service) and Kubernetes takes care of making reality converge to that description — creating the three Pods and keeping them that way even if one goes down. This declarative model, applied from files versioned in a Git repository, is exactly the idea the series will dig into in Article 3, when it introduces GitOps.
6. Conclusion and Next Steps
In this first part, we saw the real problem Kubernetes solves — orchestrating containers at scale, something impossible to manage by hand —, how it compares to loose containers and manually managed VMs, the three concepts behind any application in the cluster (Pods, Deployments and Services) and we deployed a first Deployment end to end on a local cluster. In the next article, the focus moves to kubectl day to day: essential commands, organizing resources with namespaces, ConfigMaps and Secrets, and the first deploys of real applications.
References: