Advanced · 12 lessons
Kubernetes
Kubernetes (K8s) orchestrates containers at scale. It automates deployment, scaling, load balancing, and self-healing across clusters of machines — the standard for running production container workloads.
Key Concepts
Key Takeaways
- ✓ Kubernetes manages containers across many servers as one cluster.
- ✓ Pods are the smallest deployable unit; Deployments manage pod replicas.
- ✓ Services provide stable networking; Ingress handles external HTTP routing.
- ✓ Use Helm charts to package and deploy complex applications.
Lessons in This Topic
Kubernetes Architecture
Control plane, nodes, and core components.
Control plane: API server, scheduler, controller manager, etcd (state store). Worker nodes run kubelet and container runtime (containerd). kubectl communicates with API server. Minikube/kind for local learning; managed K8s (EKS, GKE, AKS) for production.
Pods, Deployments & ReplicaSets
Run and scale containerized apps.
A Pod wraps one or more containers sharing network/storage. Deployment declares desired replicas — K8s maintains count, rolling updates, rollbacks. `kubectl apply -f deployment.yaml`. Readiness probes delay traffic until app is ready; liveness probes restart crashed containers.
Services & Ingress
Networking and external access.
ClusterIP service for internal communication. NodePort/LoadBalancer for external access. Ingress controller (nginx-ingress) routes HTTP by hostname/path with TLS termination. Define Ingress rules mapping domain → service → pods.
ConfigMaps, Secrets & Storage
Configuration and persistent data.
ConfigMaps store non-sensitive config (env vars, config files). Secrets store passwords, API keys (base64 encoded, not encrypted by default). PersistentVolumeClaims request storage from cloud provider. StatefulSets for databases needing stable identity.
Helm & GitOps Workflows
Package and automate K8s deployments.
Helm charts template K8s manifests with values.yaml for customization. `helm install myapp ./chart`. GitOps (ArgoCD, Flux) syncs Git repo state to cluster — Git becomes source of truth. PR-based deployments with audit trail.
