Kubernetes (K8s) for Beginners

Understanding the orchestrator that powers the modern web. Pods, Deployments, and Services explained.


Kubernetes (K8s) for Beginners
1 Loading...

Kubernetes (K8s) for Beginners

If Docker creates the ships (containers), Kubernetes is the captain of the fleet. It manages, scales, and heals your containerized applications automatically.

Why Do We Need It?

Running one Docker container is easy. Running 1000 containers across 50 servers, ensuring they talk to each other and restart if they crash… that’s hard. Kubernetes solves this.

Core Concepts

1. Pod

The smallest unit in K8s. A Pod runs one or more containers (usually just one).

2. Deployment

Manages Pods. You tell it “I want 3 replicas of this Pod”, and it ensures there are always 3 running.

3. Service

The networking layer. It gives your Pods a stable IP address and balances traffic between them.

A Simple YAML configuration

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

Conclusion

Kubernetes helps you move from “pet” servers (that you care for individually) to “cattle” servers (that are replaceable and managed automatically).