Why Kubernetes?
Kubernetes (K8s) is the industry-standard container orchestration platform. It automates deployment, scaling, and management of containerized applications. Originally created by Google, now the backbone of modern cloud-native infrastructure.
The Problems Kubernetes Solves
When running Docker containers in production manually, you face: How do you restart a crashed container automatically? How do you run 10 copies of a container and load-balance between them? How do you roll out a new version without downtime? How do you autoscale when traffic spikes? How do you connect containers that need to talk to each other? How do you manage hundreds of containers across dozens of servers? Kubernetes solves ALL of these problems with declarative configuration.
DevOps unifies development and operations in a continuous cycle
Kubernetes Key Capabilities
- Self-healing: Restarts crashed containers, replaces failed nodes, never serves unhealthy containers
- Auto-scaling: Scale replicas up/down based on CPU/memory/custom metrics (HPA)
- Rolling deployments: Zero-downtime updates — gradually replace old pods with new ones
- Service discovery: Containers find each other by service name — no hardcoded IPs
- Load balancing: Distribute traffic across healthy replicas automatically
- Configuration management: ConfigMaps and Secrets separate config from code
Kubernetes Architecture
// Kubernetes cluster architecture
const kubernetesCluster = {
controlPlane: {
description: "The Kubernetes 'brain' — manages the cluster",
components: {
apiServer: "All kubectl commands hit here — the REST API gateway",
etcd: "Distributed key-value store — the source of truth for cluster state",
scheduler: "Decides which node to run a new pod on",
controllerManager: "Reconciliation loops — ensures desired state = actual state",
},
location: "Managed by cloud provider (EKS, GKE, AKS) in production",
},
workerNodes: {
description: "The machines that actually run your containers",
components: {
kubelet: "Agent on each node — communicates with control plane",
kubeProxy: "Network proxy — routes traffic to the right pods",
containerRuntime: "containerd or CRI-O — runs container images",
},
count: "2-100+ nodes in production clusters",
},
coreObjects: {
Pod: "Smallest deployable unit — 1+ containers sharing network/storage",
Deployment: "Manages a set of identical Pods (replicas). Handles rolling updates",
Service: "Stable network endpoint for accessing a set of Pods",
Ingress: "HTTP routing from external internet → Services",
ConfigMap: "Non-secret configuration data",
Secret: "Sensitive data (passwords, tokens, TLS certs)",
Namespace: "Virtual cluster — isolation within a real cluster",
},
};Quick Quiz
Tip
Tip
Practice Why Kubernetes in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.
Practice Task
Note
Practice Task — (1) Write a working example of Why Kubernetes from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.
Common Mistake
Warning
A common mistake with Why Kubernetes is skipping edge case testing — empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready devops code.
Key Takeaways
- Kubernetes (K8s) is the industry-standard container orchestration platform.
- Self-healing: Restarts crashed containers, replaces failed nodes, never serves unhealthy containers
- Auto-scaling: Scale replicas up/down based on CPU/memory/custom metrics (HPA)
- Rolling deployments: Zero-downtime updates — gradually replace old pods with new ones