Back to Blog
2025-05-05Abyan Dimas

Kubernetes Explained Simply: Pods, Services, and Deployments

Container Orchestration

You've mastered Docker. You can run docker run. But what happens when you need to run 1,000 containers across 50 servers? That's where Kubernetes (K8s) comes in.

1. The Pod

The smallest unit in K8s. A Pod runs your container. Think of a Pod as a "wrapper" around your Docker container.

kind: Pod
metadata:
  name: my-app
spec:
  containers:
  - name: my-app
    image: my-app:v1

Note: Pods are mortal. If they die, they don't respawn automatically.

2. The Deployment

This is what manages Pods. You tell the Deployment: "I always want 3 copies of my app running."

If a server crashes and 1 Pod dies, the Deployment notices and immediately starts a new Pod on a healthy server to maintain the count at 3. Self-healing.

kind: Deployment
spec:
  replicas: 3
  template:
    ... (Pod spec here)

3. The Service

Now you have 3 Pods. Each has a different, dynamic IP address. How does the frontend talk to them?

A Service provides a stable, static IP and DNS name. It acts as an internal Load Balancer.

  • Frontend calls http://my-backend-service.
  • The Service forwards traffic to Pod A, Pod B, or Pod C randomly.

Why use K8s?

  • Auto-scaling: Automatically add more Pods when CPU usage is high.
  • Zero-downtime deployments: Roll out v2 slowly while v1 is still running.
  • Resource efficiency: Pack as many containers as possible onto your servers.

It has a steep learning curve, but it is the industry standard for modern infrastructure.

Share this article

Read Next