Kubernetes Tutorial
Learn Kubernetes from scratch: architecture, Pods, Deployments, Services, ConfigMaps, Secrets, storage, Helm and monitoring, with hands-on kubectl examples.
40 lessons in this tutorial
Introduction to Kubernetes
What Kubernetes is, the problem it actually solves, how it compares to Docker Compose, the core objects you need first, and whether you need it at all.
Kubernetes Architecture
The control plane and node components explained, API server, etcd, scheduler, kubelet, kube-proxy, and what breaks when each one fails.
Installing Kubernetes
Choose how to run Kubernetes, kind, minikube, Docker Desktop, k3s or a managed cloud cluster, with an honest comparison of what each is good and bad at.
Installing Kubernetes with Minikube
Set up a local Kubernetes cluster with minikube. Drivers, sizing, add-ons for Ingress and metrics, minikube tunnel, and using its Docker daemon for fast builds.
Installing Kubernetes with kind
Run multi-node Kubernetes in Docker with kind. Cluster config, loading local images, port mappings for Ingress, pinning versions, and using it in CI.
Installing kubectl
Install and configure kubectl on macOS, Linux and Windows. Version skew rules, kubeconfig, shell completion, and the plugins worth having from day one.
kubectl Basics
How kubectl talks to the cluster, imperative vs declarative workflows, apply vs create, output formatting, and the commands you will use every day.
kubectl get and describe
Inspect Kubernetes resources with get and describe. Output formats, label and field selectors, jsonpath, and reading the events that explain most failures.
kubectl apply and delete
Manage Kubernetes objects declaratively. Apply vs create vs replace, server-side apply, kubectl diff, cascading deletion, and force-deleting a stuck resource.
kubectl exec, logs, and port-forward
Debug running workloads. Reading logs including crashed containers, getting a shell inside a Pod, ephemeral debug containers, and tunnelling a local port.
kubectl contexts and namespaces
Work safely across multiple clusters. How kubeconfig is structured, switching contexts and namespaces, and avoiding the wrong-cluster mistake.
Kubernetes Pods
What a Pod is and why Kubernetes schedules pods rather than containers. Shared networking and storage, and debugging Pending and CrashLoopBackOff.
Kubernetes Pod Manifest
Read and write Pod YAML. Required fields, containers, ports, environment, volumes, securityContext, and the fields that are immutable once created.
Kubernetes Pod Lifecycle
Pod phases and container states explained. Pending to Running to Succeeded, restart policy and backoff, termination and SIGTERM, and how to read a Pod's status.
Multi-container Pods
When a Pod should hold more than one container. Init containers, native sidecars, the adapter and ambassador patterns, and when to use two Pods.
Kubernetes Probes
Liveness, readiness and startup probes explained. What each one controls, the timing fields that matter, and the misconfigurations that cause outages.
Kubernetes Deployments
How Deployments manage ReplicaSets and pods, how rolling updates and rollbacks actually work, and how to debug a rollout that never finishes.
Creating Kubernetes Deployments
Write, apply, inspect and scale a Deployment: the required fields, the immutable selector, how ReplicaSets relate to it, and the errors you meet first.
Kubernetes Rolling Updates
How rolling updates work in Kubernetes, maxSurge and maxUnavailable, why readiness probes make them safe, graceful shutdown, and diagnosing a stalled rollout.
Kubernetes Rollbacks
Undo a bad deployment with kubectl rollout undo. How revision history works, recording change causes, revisionHistoryLimit, and what a rollback cannot fix.
Kubernetes Services
How Services give pods stable networking. ClusterIP, NodePort, LoadBalancer and headless, DNS naming, port vs targetPort, and why a Service has no endpoints.
Kubernetes Service: ClusterIP
The default Kubernetes Service type. Internal virtual IPs, DNS naming, how kube-proxy implements it, headless Services, and debugging an empty endpoint list.
Kubernetes Service: NodePort
Expose a Service on a static port across every node. How NodePort layers on ClusterIP, the 30000-32767 range, externalTrafficPolicy, and when not to use it.
Kubernetes Service: LoadBalancer
Provision a cloud load balancer for a Kubernetes Service. Annotations, externalTrafficPolicy, cost at scale, EXTERNAL-IP pending, and MetalLB on bare metal.
Kubernetes Ingress
Route external HTTP traffic to Services with Ingress. Controllers, host and path rules, pathType, TLS with cert-manager, and why your Ingress returns 404.
ConfigMaps and Secrets
Separating configuration from images. ConfigMaps vs Secrets, env vars vs volume mounts, which updates live, and what Secrets really protect.
Kubernetes ConfigMaps
Create ConfigMaps from literals, files or YAML and consume them as environment variables or mounted files, including why updates sometimes do not appear.
Kubernetes Secrets
Create and consume Kubernetes Secrets for passwords, registry credentials and TLS material, plus what base64 does not protect and how production teams handle it.
Kubernetes Storage
How Kubernetes separates workloads from durable data. Ephemeral vs persistent volumes, emptyDir, hostPath, PVs and PVCs, access modes and when to use each.
Persistent Volumes and PersistentVolumeClaims
How PVs and PVCs bind, what the access modes and reclaim policies really mean, how to expand a volume, and how to recover data from a released PV.
Kubernetes StorageClasses
Dynamic volume provisioning with StorageClasses. Provisioners, parameters, reclaim policy, volumeBindingMode, expansion, and setting a sensible default.
Kubernetes Namespaces
How namespaces partition a cluster. What is and is not namespaced, cross-namespace DNS, quotas and RBAC, and why a namespace can get stuck Terminating.
Kubernetes Resource Management
How CPU and memory requests and limits drive scheduling, throttling and eviction in Kubernetes. QoS classes, units, and the defaults that cause outages.
Kubernetes Requests and Limits
Set CPU and memory requests and limits correctly. Enforcement behaviour, QoS classes, LimitRange defaults, and how to diagnose throttling and OOMKilled.
Horizontal Pod Autoscaler
Scale Kubernetes workloads automatically with the HPA. How the replica formula works, why it needs resource requests, scaling behaviour, and custom metrics.
Helm for Kubernetes
What Helm is and when it earns its complexity. Charts, releases, repositories, how upgrades and rollbacks work, and how it compares to Kustomize.
Installing and Using Helm
Install Helm on macOS, Linux or Windows, add repositories, and run the install, upgrade, rollback and uninstall commands that make up the daily workflow.
Understanding Helm Charts
Helm chart structure explained. Chart.yaml, values.yaml, templates, built-in objects, helpers, dependencies, and how to debug a template that renders wrongly.
Helm Values, Upgrades, and Rollbacks
Override Helm chart configuration with values files and --set, understand precedence, upgrade safely with --atomic, and roll back when a release goes wrong.
Kubernetes Monitoring
Monitor a Kubernetes cluster properly, metrics-server vs Prometheus, kube-state-metrics, the signals that matter, logging, and alerts worth waking up for.