Skip to content
What is Kubernetes — Simple Explanation with Examples

What is Kubernetes — Simple Explanation with Examples

DodaTech Updated Jun 20, 2026 5 min read

Kubernetes (often abbreviated as K8s — the 8 replacing “ubernete”) is an open-source container orchestration platform. It automates deploying, scaling, load balancing, and managing containerized applications across a cluster of machines, freeing operators from manual management.

What You’ll Learn

This article covers Kubernetes core concepts — pods, nodes, deployments, services — with a working YAML example. You’ll understand what problems K8s solves, how it compares to Docker, and why it dominates cloud infrastructure. Kubernetes runs at Google, Netflix, Spotify, and most large-scale deployments.

The Problem Kubernetes Solves

Running containers with Docker alone works for one or two servers. But when you have dozens of microservices across hundreds of machines, you need:

  • Scheduling — Which server should run which container?
  • Health monitoring — What happens when a container crashes?
  • Scaling — How do you add replicas when traffic spikes?
  • Networking — How do services find and talk to each other?
  • Rolling updates — How do you update without downtime?
  • Storage — How do containers access persistent data?

Kubernetes solves all of these declaratively. You describe the desired state (e.g., “run 3 replicas of my API server on port 8080”), and Kubernetes continuously works to make the actual state match your description.

The Orchestra Conductor Analogy

An orchestra has many musicians (containers), each playing a different instrument (application). Without a conductor, they play at different tempos, miss cues, and produce chaos.

Kubernetes is the conductor:

  • It tells each musician when to start and stop.
  • It ensures the right number of violins (containers) are playing.
  • If a musician gets sick (container crashes), the conductor brings in a substitute.
  • When a new song (deployment) needs to be played, the conductor coordinates the transition.
  • The conductor ensures everyone plays in harmony (networking, service discovery).

Docker builds the instruments; Kubernetes conducts the performance.

Core Concepts

Pod

The smallest deployable unit in Kubernetes. A pod wraps one or more containers that share storage and network. Usually you run one container per pod.

apiVersion: v1
kind: Pod
metadata:
  name: my-app
spec:
  containers:
  - name: app
    image: nginx:1.25
    ports:
    - containerPort: 80

Node

A worker machine (physical or VM) in the cluster. Each node runs pods via the kubelet agent. Control plane components manage the cluster from the master nodes.

Cluster

A set of nodes grouped together. The control plane makes global decisions, and worker nodes run the actual workloads.

Deployment

A resource that declares the desired state for a set of pods. It handles rolling updates, rollbacks, and replica management.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-server
spec:
  replicas: 3
  selector:
    matchLabels:
      app: api
  template:
    metadata:
      labels:
        app: api
    spec:
      containers:
      - name: api
        image: myapp/api:v2.1.0
        ports:
        - containerPort: 3000

Service

An abstraction that exposes a set of pods as a network service. It provides a stable IP and DNS name, and load-balances traffic across pods.

apiVersion: v1
kind: Service
metadata:
  name: api-service
spec:
  selector:
    app: api
  ports:
  - protocol: TCP
    port: 80
    targetPort: 3000
  type: LoadBalancer

How Kubernetes Works

  1. You write YAML manifests describing your desired state.
  2. kubectl apply -f manifest.yaml sends the manifest to the Kubernetes API server.
  3. The control plane stores the desired state in etcd (distributed key-value store).
  4. The scheduler finds suitable nodes for each pod based on resource requirements.
  5. The kubelet on each node pulls container images and starts pods.
  6. The controller manager continuously monitors the cluster, ensuring actual state matches desired state.

Scaling and Self-Healing

Kubernetes scales automatically or on demand:

# Scale a deployment to 10 replicas
kubectl scale deployment api-server --replicas=10

# Or use Horizontal Pod Autoscaler (HPA) for automatic scaling
kubectl autoscale deployment api-server --min=3 --max=20 --cpu-percent=70

Self-healing happens automatically: if a pod crashes, Kubernetes creates a replacement. If a node goes down, pods are rescheduled onto healthy nodes.

Kubernetes vs Docker

AspectDockerKubernetes
PurposeBuild and run containersOrchestrate containers across clusters
ScopeSingle hostMulti-host cluster
ScalingManual via compose scaleAutomatic, declarative
Self-healingRestart policy onlyFull health checks, rescheduling
Load balancingBasic port mappingBuilt-in Service + Ingress
Rolling updatesManual or composeDeclarative with rollback
Secret managementBasic env varsNative secrets + encryption

Docker and Kubernetes are complementary. You use Docker to build and package your application, and Kubernetes to run and manage it at scale.

Managed Kubernetes (Cloud Providers)

ProviderServiceNotes
AWSEKS (Elastic Kubernetes Service)Integrates with VPC, IAM, RDS
AzureAKS (Azure Kubernetes Service)Managed control plane, Azure AD
Google CloudGKE (Google Kubernetes Engine)Google invented Kubernetes, fastest upgrades
DigitalOceanDOKSSimple, affordable managed K8s
IBM CloudIKSEnterprise-focused

Common Use Cases

  1. Microservices deployment — Each microservice becomes a deployment and is exposed via a service. K8s handles routing, scaling, and health.

  2. Batch processing — Run data processing jobs (Spark, Hadoop) on a Kubernetes cluster. Jobs run to completion and free resources automatically.

  3. CI/CD runners — Run GitHub Actions self-hosted runners or GitLab runners on Kubernetes for elastic CI capacity.

  4. Machine learning — ML training jobs run as Kubernetes Jobs with GPU resources, auto-scaled and checkpointed.

  5. Stateful applications — Databases (PostgreSQL, Cassandra) run as StatefulSets with persistent volumes for stable storage.

FAQ

What is the difference between Docker Swarm and Kubernetes? |
Docker Swarm is simpler but less feature-rich. Kubernetes has a steeper learning curve but offers more advanced scheduling, auto-scaling, service mesh integration, and a larger ecosystem. Kubernetes is the industry standard.
Do I need Kubernetes for a small project? |
No. For a side project or small team, a single VM or a platform like Railway, Fly.io, or Heroku is simpler. Kubernetes shines when you have multiple services, need auto-scaling, or operate across multiple teams.
What is a Kubernetes Operator? |
An Operator is a custom controller that extends Kubernetes to manage complex stateful applications (databases, message queues) using Kubernetes-native APIs. For example, the Prometheus Operator manages monitoring stacks.
What is etcd in Kubernetes? |
etcd is the distributed key-value store that Kubernetes uses to persist all cluster state (configs, secrets, service discovery data). It is the source of truth for the cluster.
Is Kubernetes free? |
Kubernetes itself is open-source and free. You pay for the underlying infrastructure (VMs or cloud instances). Managed services (EKS, AKS, GKE) add a small management fee on top of compute costs.

Related Terms

What is Docker — What is a Microservice — What is an API — What is CI/CD

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro