Skip to content

Kubernetes

In one line

Kubernetes (K8s) is a platform that automates deploying, scaling, and managing containerized applications across clusters of machines.

In simple words

Kubernetes, often abbreviated as K8s, is a system for managing containers at scale. When you have just a few containers, you can manage them manually with Docker. But when you have hundreds or thousands of containers running across dozens of servers, you need Kubernetes.

Kubernetes handles: scheduling (deciding which server runs which container), scaling (adding or removing containers based on load), self-healing (restarting failed containers), and rolling updates (updating without downtime).

You describe what you want in YAML files — e.g., "I want 3 replicas of my web app" — and Kubernetes makes it happen. If a server crashes, Kubernetes automatically moves the containers to healthy servers.

Example

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
        - name: my-app
          image: my-app:latest

This Deployment tells Kubernetes to run 3 replicas of the my-app container image.

How it works

  1. You write YAML manifests describing your desired state (e.g., 3 replicas).
  2. You submit them to the Kubernetes API server with kubectl apply.
  3. The scheduler places pods on available nodes.
  4. Controllers continuously reconcile actual state to match desired state.
  5. If a pod dies, Kubernetes restarts it automatically.

Common confusions

  • Confused with: Docker

    The difference: Docker builds and runs individual containers; Kubernetes orchestrates many containers across a cluster of machines.

Related terms

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary