Skip to content
Tutorials Center
My learning

Topics

Kubernetes Tutorial

Learn Kubernetes step by step: 78 lessons in 13 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Kubernetes? Learn what Kubernetes is, which problems it solves, and why its desired-state model matters, with a runnable desired-versus-actual diff in Python.
  2. 2 Cluster Architecture Understand the Kubernetes control plane (API server, etcd, scheduler, controllers) and node components, and follow a request from kubectl to a running pod.
  3. 3 Running a Local Cluster Compare kind, minikube, k3d and Docker Desktop Kubernetes, see how managed EKS, GKE and AKS differ, and pick the right cluster for learning and testing.
  4. 4 Building a Cluster with kubeadm Build a multi-node Kubernetes cluster step by step with kubeadm: prerequisites, containerd, kubeadm init and join, installing a CNI plugin, and quicker kind or k3s options.
  5. 5 kubectl Essentials Learn the kubectl commands you use daily: contexts, get, describe, apply, delete, output formats, explain and dry-run, plus a JSONPath-style extractor in Python.
  6. 6 YAML and the Shape of a Manifest Learn the apiVersion, kind, metadata, spec and status layout of Kubernetes manifests, labels, multi-document files and the YAML traps that bite beginners.
  7. 7 The Kubernetes API, Resources and Versions Understand API groups, versions, kinds versus resources, REST paths, custom resources and how deprecations remove old apiVersions, with a router in Python.

Pods

  1. 8 Pods Learn what a Kubernetes Pod is, how its spec describes containers, why containers in one Pod share a network and volumes, and when to use more than one.
  2. 9 Container Images in Kubernetes: Tags, Digests and Pull Policy Learn how Kubernetes names and pulls container images: tags vs digests, imagePullPolicy defaults, private registries with imagePullSecrets, updates and pull errors.
  3. 10 Pod Lifecycle and Phases Follow a Pod from Pending to Running to Succeeded or Failed. Learn container states, restartPolicy, graceful termination and how CrashLoopBackOff backoff works.
  4. 11 Liveness, Readiness and Startup Probes Learn the three Kubernetes probes, the HTTP, TCP, exec and gRPC probe types, how thresholds and delays work, and the mistakes that cause restart loops.
  5. 12 Resource Requests and Limits Understand CPU and memory requests and limits, millicores and Mi units, QoS classes, OOMKilled, CPU throttling, and a first look at LimitRange and ResourceQuota.
  6. 13 Init Containers and Sidecars Use init containers for setup work, native sidecar containers for long-running helpers, and the ambassador and adapter patterns, with start and stop ordering.
  7. 14 Labels, Selectors and Annotations Learn label syntax, equality and set-based selectors, the recommended app.kubernetes.io labels, and when to use annotations instead of labels.

Workloads

  1. 15 ReplicaSets Learn how a Kubernetes ReplicaSet keeps a set number of identical pods alive, how selectors and ownerReferences work, and why you rarely create one yourself.
  2. 16 Deployments Learn how Kubernetes Deployments manage ReplicaSets: the manifest, scaling, rollout status, revision history and the controller logic behind them.
  3. 17 Rolling Updates and Rollbacks Understand how a Deployment replaces pods gradually with maxSurge and maxUnavailable, how to pause, inspect and roll back a rollout, and how history is kept.
  4. 18 Deployment Strategies Compare Recreate, rolling, blue-green and canary releases on Kubernetes, build them with labels and Services, and see where Argo Rollouts and Flagger fit.
  5. 19 StatefulSets Learn how StatefulSets give pods stable names, ordered startup, a headless Service and per-pod volumes, and how their update strategies differ from Deployments.
  6. 20 DaemonSets Learn how a DaemonSet runs one pod per node for log shippers and monitoring agents, how node selection and tolerations work, and how its updates roll out.
  7. 21 Jobs and CronJobs Run work to completion with Kubernetes Jobs and schedule it with CronJobs: completions, parallelism, backoffLimit, TTL, indexed jobs and concurrencyPolicy.

Services and Networking

  1. 22 Services Learn why Kubernetes Services exist, how selectors pick Pods, what EndpointSlices are, how port and targetPort differ, and how Services get DNS names.
  2. 23 NodePort, LoadBalancer and ExternalName Compare the Kubernetes Service types: ClusterIP, NodePort, LoadBalancer, ExternalName and headless Services, plus externalTrafficPolicy and cost trade-offs.
  3. 24 DNS and Service Discovery How Kubernetes DNS works: CoreDNS, Service and Pod names, search domains and ndots, SRV records, and a practical playbook for debugging DNS failures.
  4. 25 How Services Really Work: kube-proxy Look inside Kubernetes Services: kube-proxy, virtual IPs, DNAT, iptables vs IPVS vs nftables modes, connection tracking and session affinity.
  5. 26 Ingress and Ingress Controllers Route HTTP traffic into a cluster with Kubernetes Ingress: host and path rules, pathType, IngressClass, TLS termination, controllers and annotation pitfalls.
  6. 27 Gateway API Learn the Kubernetes Gateway API: GatewayClass, Gateway and HTTPRoute, how roles are separated, weighted traffic splitting, and how it compares with Ingress.
  7. 28 Network Policies Learn how Kubernetes NetworkPolicy works: default allow, deny-all, ingress and egress rules, selector semantics, the CNI requirement and common patterns.
  8. 29 Pod Networking and CNI Understand the Kubernetes network model, how CNI plugins such as Calico, Cilium and Flannel give Pods IPs, how pod CIDRs are split, and overlay versus routed networks.

Configuration and Secrets

  1. 30 ConfigMaps Learn Kubernetes ConfigMaps: create them from literals and files, inject as environment variables or mounted files, use immutable ConfigMaps, and know what updates.
  2. 31 Secrets Learn Kubernetes Secrets: the built-in types, why base64 is not encryption, env vars versus volumes, encryption at rest, and how to limit who can read them.
  3. 32 External Secrets, Sealed Secrets and Config Patterns Keep secrets out of Git: compare External Secrets Operator, Sealed Secrets, SOPS and the Secrets Store CSI driver, plus twelve-factor configuration patterns.
  4. 33 Environment Variables and the Downward API Set container environment variables in Kubernetes with env, envFrom and valueFrom, expose pod metadata with the Downward API, and override command and args.

Storage

  1. 34 Volumes Understand Kubernetes volumes: emptyDir, hostPath, configMap, secret and projected volumes, ephemeral volumes, volumeMounts, subPath and how mount paths resolve.
  2. 35 PersistentVolumes and Claims Learn how PersistentVolumes and PersistentVolumeClaims separate storage supply from demand, with access modes, reclaim policies, binding rules and volume phases.
  3. 36 StorageClasses and Dynamic Provisioning Use StorageClasses so Kubernetes creates disks on demand: provisioners, volume binding modes, volume expansion, CSI drivers, snapshots and the default class.
  4. 37 Running Databases and Backups Decide when to run a database on Kubernetes, deploy it with a StatefulSet and PVC or an operator, and protect it with Velero, snapshots and tested restores.

Scheduling and Scaling

  1. 38 How the Scheduler Works See how kube-scheduler picks a node for every pod: the queue, filtering and scoring phases, resource fit, nodeName, binding, and why pods stay Pending.
  2. 39 Static Pods and Manual Scheduling Learn how the kubelet runs static Pods from a manifest directory, what mirror Pods are, how nodeName bypasses the scheduler, and why a running Pod cannot be moved.
  3. 40 Node Selectors, Affinity and Anti-Affinity Control where pods run with nodeSelector, node affinity, pod affinity, anti-affinity and topology spread constraints, with a runnable affinity evaluator.
  4. 41 Taints and Tolerations Learn how node taints repel pods and tolerations let them in: NoSchedule, PreferNoSchedule, NoExecute, dedicated nodes and built-in taints, with runnable matchers.
  5. 42 Namespaces, Quotas and Limit Ranges Split a cluster with namespaces, cap each team with ResourceQuota, set per-container defaults with LimitRange, and avoid the default-namespace traps.
  6. 43 Horizontal Pod Autoscaler How the Horizontal Pod Autoscaler works: metrics-server, the scaling formula, tolerance, stabilization windows, custom metrics and KEDA, with a runnable simulation.
  7. 44 Vertical Autoscaling and Cluster Autoscaler Right-size pods with the Vertical Pod Autoscaler, add and remove nodes with Cluster Autoscaler or Karpenter, and see bin packing decide the node count.
  8. 45 PodDisruptionBudgets, Priority and Eviction Keep services up during drains and upgrades with PodDisruptionBudgets, and learn priority classes, preemption and node-pressure eviction with runnable simulations.

Security

  1. 46 Authentication and RBAC Learn how Kubernetes decides who you are and what you may do: users, service accounts, Roles, ClusterRoles, bindings and least privilege, with a Python RBAC evaluator.
  2. 47 Service Accounts and Workload Identity How pods get an identity in Kubernetes: ServiceAccounts, projected tokens, automounting, and cloud workload identity such as IRSA and GKE Workload Identity.
  3. 48 Pod Security and Security Contexts Lock down pods with securityContext: runAsNonRoot, dropped capabilities, seccomp and read-only filesystems, then enforce the Baseline and Restricted levels with Pod Security Admission.
  4. 49 Admission Control and Policy Learn how admission controllers, webhooks and ValidatingAdmissionPolicy with CEL reject bad manifests, and how Kyverno and OPA Gatekeeper fit in, with a Python policy engine.
  5. 50 Supply Chain and Cluster Hardening Secure what you run and where it runs: image signing and scanning, imagePullSecrets, etcd encryption, audit logs and the CIS benchmark, with a hardening checklist in Python.

Packaging and Delivery

  1. 51 Kustomize Customize Kubernetes manifests without templates: bases and overlays, patches, generators, image and name changes, plus a Python model of strategic merge patching.
  2. 52 Helm: Charts and Releases Learn how Helm packages Kubernetes manifests into charts, how values customize them, and how install, upgrade and rollback create release history.
  3. 53 Writing Helm Charts Write your own Helm chart: template syntax, helpers, pipelines, if and range, hooks, tests and dependencies, plus a runnable mini template engine.
  4. 54 GitOps with Argo CD and Flux Learn GitOps for Kubernetes: Git as the source of truth, pull-based sync, drift detection, self-heal, app-of-apps and secrets, with a runnable sync loop.

Extending Kubernetes

  1. 55 Controllers and the Reconcile Loop Understand how Kubernetes controllers work: level-triggered logic, informers, work queues, idempotency and owner references, with a runnable controller.
  2. 56 Custom Resources and Operators Extend Kubernetes with CustomResourceDefinitions and operators: schemas, validation, kubebuilder and operator-sdk, plus a runnable Database operator stand-in.
  3. 57 Serverless and Event-Driven Scaling: Knative and KEDA Scale Kubernetes workloads to zero and on events: KEDA ScaledObjects for queues and schedules, Knative Services for request-driven apps, and how both differ from the HPA.

Operations and Observability

  1. 58 Logging in Kubernetes Learn how Kubernetes logging works: stdout and stderr, kubectl logs, node-level agents, Loki and EFK, structured logs, plus a runnable log aggregator.
  2. 59 Nodes: Status, Conditions, Leases, Cordon and Drain Understand Kubernetes nodes: registration, capacity and allocatable, conditions, NotReady causes, lease heartbeats, cordon and drain, and graceful or non-graceful shutdown.
  3. 60 Metrics and Monitoring with Prometheus Monitor Kubernetes with metrics-server, Prometheus, ServiceMonitor and Grafana. Learn counters, rates, the four golden signals and how alert rules fire.
  4. 61 Tracing and Service Meshes Follow a request across microservices with distributed tracing and OpenTelemetry, and learn what Istio and Linkerd add: mTLS, retries, sidecarless meshes.
  5. 62 Troubleshooting Playbook A practical Kubernetes troubleshooting playbook: Pending, ImagePullBackOff, CrashLoopBackOff, OOMKilled, empty Service endpoints, DNS failures and kubectl debug.
  6. 63 Debugging Applications in a Cluster: Port-Forward, Ephemeral Containers and Remote Debuggers Debug a running Kubernetes app: kubectl port-forward to reach Pods privately, kubectl debug for tools, attaching IDE debuggers (Java JDWP, Node, Python, Go) and safer practices.
  7. 64 Cluster Operations and Upgrades Upgrade a Kubernetes cluster safely: version skew rules, upgrade order, node pools, etcd snapshots and restores, certificate expiry and managed vs self-managed.
  8. 65 Cost, Reliability and Multi-Cluster Cut Kubernetes cost with right-sizing and spot nodes, compare multi-tenancy models and vcluster, plan multi-cluster setups and use a high availability checklist.

Projects

  1. 66 Project: Deploy a Web App with a Database Build a two-tier app on Kubernetes: Deployments, Services, Ingress, ConfigMap, Secret and a PersistentVolumeClaim, plus a manifest validator that catches wiring mistakes.
  2. 67 Project: WordPress and MySQL with PersistentVolumes Deploy WordPress with MySQL on Kubernetes: Secret, StatefulSet with a volume claim, WordPress Deployment with a PVC, Services, Ingress, probes and backups.
  3. 68 Project: Microservices with Probes and Autoscaling Deploy three cooperating services on Kubernetes with probes, service discovery, an autoscaler, a disruption budget and network policies, plus runnable simulations.
  4. 69 Project: Package an App as a Helm Chart Turn plain manifests into a Helm chart with helpers, dev and prod values, a conditional ingress and a test, with a runnable Python renderer to see how it works.
  5. 70 Project: CI/CD Pipeline to Kubernetes Build a pipeline that tests, scans and pushes an image, updates a config repo and lets Argo CD sync and roll back, with runnable promotion and sync models.
  6. 71 Project: A Tiny Operator Design a Database custom resource, write its reconcile logic with status conditions and a finalizer, and run a Python operator simulation to see it work.
  7. 72 Project: A Self-Hosted Git Server (Gitea) with Helm Install a self-hosted Git server on Kubernetes with the Gitea Helm chart: values file, persistent volume, ingress, first admin and repository push, upgrade and cleanup.
  8. 73 Project: Build a Mini Cluster Simulator Build a small Python model of a cluster with a scheduler, a deployment controller, a service load balancer and an autoscaler, and watch them react to load and node failure.

Practice

  1. 74 Exercises: Pods, Deployments and Services Practice writing Kubernetes manifests for a Pod, a Deployment and a Service, fix broken YAML and check your work with runnable validators and full solutions.
  2. 75 Exercises: Scheduling, Security and Troubleshooting Eight scenario exercises with full solutions: pods stuck in Pending, taints, selectors, Pod Security, RBAC, probes, PodDisruptionBudgets and broken manifests to diagnose.
  3. 76 Kubernetes Interview Questions Prepare for a Kubernetes interview: architecture, workloads, networking, storage, security and troubleshooting questions with concise answers, diagrams and runnable models.
  4. 77 CKA, CKAD and CKS Study Guide Prepare for the Kubernetes certifications: exam domains, kubectl speed tricks, imperative generators, aliases, time management and practice tasks for CKA, CKAD and CKS.
  5. 78 Kubernetes Cheat Sheet One-page Kubernetes cheat sheet: kubectl commands, manifest skeletons, probes, resources, selectors, rollout and RBAC commands and a troubleshooting table of status messages.