Kubernetes (aka K8s) is an open-source container orchestration platform that automates deployment, scaling, and management of containerized applications. In short:

Kubernetes runs your containers reliably, at scale, and without manual babysitting.

What Kubernetes Does

ProblemKubernetes Solution
Deploying many containersDeclarative YAML + Controllers
Scaling containers on demandAutoscaling
Handling container failuresSelf-healing (restarts, rescheduling)
Managing service discoveryDNS-based internal discovery
Load balancing trafficBuilt-in Services & Ingress
Rolling out updates safelyRolling updates, canary deploys
Managing multi-host clustersSchedules containers on nodes

Core Components

1. Pod

  • The smallest deployable unit.
  • One or more containers with shared resources (network, storage).
  • Typically runs one container per pod in practice.

2. Node

  • A physical or virtual machine in the cluster.
  • Runs container runtime (Docker, containerd) and Kubelet.

3. Cluster

  • A group of nodes managed by Kubernetes.

4. Deployment

  • Describes desired state (e.g., 3 replicas of app:v2) in YAML.
  • Kubernetes ensures that actual state matches desired state.

5. Service

  • Stable network identity (DNS + port) for a group of pods.
  • Handles load balancing across pod replicas.

6. Ingress

  • Exposes HTTP(S) routes from outside the cluster to services.
  • Supports routing rules, TLS, etc.

7. ConfigMap & Secret

  • Externalize configuration (ConfigMaps for plain data, Secrets for sensitive data).

8. Volume

  • Persistent storage (can be disk, cloud storage, NFS, etc.).

Key Concepts

Declarative Model

You tell K8s what you want in YAML (e.g., “3 replicas”), and it figures out how to make it happen.

Control Loop

Kubernetes controllers constantly compare the actual state with the desired state and reconcile differences.

Labels & Selectors

Tag and filter resources for grouping, service discovery , etc.

  • Deploying microservices
  • Rolling out canary/blue-green deployments
  • Auto-scaling based on CPU/memory
  • Zero-downtime upgrades
  • Hybrid cloud or multi-cloud deployments

Dev Workflow Example

1. Write YAML files for:

  • Deployment: how many replicas
  • Service: internal networking
  • Ingress: external exposure

2. Run kubectl apply -f deployment.yaml

3. Kubernetes:

  • Schedules pods on nodes
  • Exposes them via services
  • Monitors health, restarts failed pods
  • Scales up/down as needed

Things to watch out for

ChallengeSolution / Tool
YAML fatigueHelm, Kustomize
Debuggingkubectl logs, kubectl describe
Cluster cost/complexityStart with managed K8s (EKS, GKE, AKS)
Network managementUse CNI plugins (Calico, Flannel)
Persistent storageUse StatefulSets, PVCs
Secrets managementUse external tools (Vault, SOPS)

Ecosystem Add-ons

NeedTool
PackagingHelm
GitOpsArgoCD, Flux
ObservabilityPrometheus + Grafana
Security ScanningTrivy, Kube-bench
CI/CDTekton, Jenkins, GitHub Actions
Service MeshIstio, Linkerd

Mental Model

“Kubernetes is like an operating system for the cloud. Instead of managing apps on a single server, you tell Kubernetes what to run — and it figures out where and how to run it.”