Kubernetes Introduction
Kubernetes Introduction
Section titled βKubernetes IntroductionβKubernetes (K8s) is an open-source container orchestration platform. It automates deploying, scaling, and managing containerised applications across a cluster of machines.
Why Kubernetes Exists
Section titled βWhy Kubernetes ExistsβDocker solves packaging. Kubernetes solves operations at scale.
Without orchestration you face:
- Manual restarts when containers crash
- No built-in load balancing across replicas
- No rolling deployments without downtime
- No automatic scaling under load
Kubernetes handles all of this declaratively β you describe desired state, and the control plane makes it reality.
Architecture Overview
Section titled βArchitecture OverviewβControl Plane (manages the cluster)βββ API Server β single entry point for all operationsβββ etcd β distributed key-value store for cluster stateβββ Scheduler β assigns pods to nodes based on resourcesβββ Controller Manager β reconciliation loops (deployments, replicas, etc.)
Worker Nodes (run the workloads)βββ kubelet β agent that runs pods on the nodeβββ kube-proxy β network rules and service routingβββ Container Runtime β containerd or DockerKey Concepts
Section titled βKey Conceptsβ| Concept | What it is |
|---|---|
| Pod | Smallest deployable unit β one or more containers |
| Node | A machine (VM or physical) in the cluster |
| Cluster | One control plane + multiple worker nodes |
| Namespace | Logical partition within a cluster |
| Deployment | Manages replicas and rolling updates of pods |
| Service | Stable network endpoint in front of pods |
| ConfigMap / Secret | External configuration and sensitive values |
| Ingress | HTTP routing from outside the cluster to services |
Kubernetes vs Plain Docker
Section titled βKubernetes vs Plain Dockerβ| Concern | Docker alone | Kubernetes |
|---|---|---|
| Container restart on crash | Manual or restart policy | Automatic |
| Load balancing | Manual with nginx/HAProxy | Built-in via Services |
| Rolling updates | Manual scripting | kubectl rollout |
| Auto-scaling | Not built-in | HorizontalPodAutoscaler |
| Multi-host networking | Complex setup | Built-in overlay network |
Use plain Docker for local development and single-host deployments. Use Kubernetes when you need multi-node workloads, auto-scaling, or zero-downtime deployments.
When to Use Kubernetes
Section titled βWhen to Use KubernetesβGood fit:
- Microservices with independent scaling requirements
- High-availability production workloads
- Teams that ship frequently and need zero-downtime deploys
Might be overkill:
- Small single-service apps
- Prototypes or internal tools
- Teams without operational capacity to maintain a cluster (consider managed alternatives like Cloud Run or Azure Container Apps)
Managed Kubernetes Options
Section titled βManaged Kubernetes OptionsβAll major clouds offer managed control planes so you only manage worker nodes:
- GKE β Google Kubernetes Engine
- AKS β Azure Kubernetes Service
- EKS β Amazon Elastic Kubernetes Service
Next Steps
Section titled βNext Stepsβ- Pods β the smallest deployable unit
- Deployments β running and updating replicas
- Services β exposing pods on the network
- kubectl Commands β essential CLI reference