Learn Kubernetes

Run and scale containerised applications across a cluster of machines

34 lessons · 6 hours · 4 levels · covers Kubernetes 1.35

Kubernetes is the open-source container orchestrator: you declare the desired state of your applications in YAML and its controllers keep the cluster matching it, scheduling containers, replacing failed ones, rolling out new versions and wiring up networking and storage. It is the common platform behind managed services such as EKS, GKE and AKS.

Before you start

Kubernetes builds on these; the tree links to the exact lessons you need.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics12 lessons · 2 hours in total
2. PracticalUse it productively at work, with the usual idioms22 lessons · 3 hours in total
3. AdvancedThe less common features, performance and trade-offs29 lessons · 5 hours in total
4. ExpertInternals and the edge cases experts know34 lessons · 6 hours in total

The Kubernetes tree

KubernetesWhat Kubernetes is forWhat Kubernetes isforCluster architectureCluster architectureA local cluster with kind or minikubeA local cluster withkind or minikubekubectl and kubeconfigkubectl andkubeconfigManifests and kubectl applyManifests andkubectl applyPodsPodsLabels, selectors and annotationsLabels, selectors andannotationsDeployments and ReplicaSetsDeployments andReplicaSetsServicesServicesNamespacesNamespacesConfigMaps and SecretsConfigMaps andSecretsLogs, exec, events and port-forwardLogs, exec, eventsand port-forwardRolling updates and rollbacksRolling updates androllbacksLiveness, readiness and startup probesLiveness, readinessand startup probesRequests, limits and QoSRequests, limits andQoSIngress and the Gateway APIIngress and theGateway APIDNS and service discoveryDNS and servicediscoveryVolumes, PersistentVolumes and claimsVolumes,PersistentVolumes…StatefulSetsStatefulSetsJobs and CronJobsJobs and CronJobsDaemonSetsDaemonSetsKustomize overlaysKustomize overlaysImages and containersImages andcontainersEnvironment variables and configurationEnvironmentvariables and confi…Healthchecks and restart policiesHealthchecks andrestart policiesResource limitsResource limitsPersisting data with volumesPersisting data withvolumes
Essentials and Practical shown (22 of 34 lessons); the full list is below. Click a lesson to read it.

All 34 lessons, in order

Foundations

  1. What Kubernetes is for · Essentials · 8 min

    Kubernetes runs containers across many machines and keeps them in the state you declared.

  2. Cluster architecture · Essentials · 10 min

    The control plane (API server, etcd, scheduler, controllers) decides; kubelets on worker nodes run the containers.

  3. A local cluster with kind or minikube · Essentials · 10 min

    Run a disposable Kubernetes cluster on your laptop to learn and test safely.

  4. kubectl and kubeconfig · Essentials · 10 min

    Use kubectl's get, describe, apply and delete verbs, and switch clusters and namespaces with contexts.

  5. Manifests and kubectl apply · Essentials · 10 min

    Describe objects in YAML with apiVersion, kind, metadata and spec, and manage them declaratively with apply.

  6. Namespaces · Essentials · 6 min

    Namespaces partition one cluster into named scopes for names, access control and quotas.

Workloads

  1. Pods · Essentials · 10 min

    A pod is one or more containers that share a network namespace and volumes, scheduled together on one node.

  2. Labels, selectors and annotations · Essentials · 7 min

    Labels are key-value tags that selectors use to group objects; annotations hold non-identifying metadata.

  3. Deployments and ReplicaSets · Essentials · 10 min

    A Deployment keeps N identical pods running through a ReplicaSet and manages rollouts between versions.

  4. StatefulSets · Practical · 10 min

    Run stateful apps with stable pod names, stable DNS and a dedicated volume per replica.

  5. Jobs and CronJobs · Practical · 8 min

    Run tasks to completion with Jobs, retries and parallelism, and on a schedule with CronJobs.

  6. DaemonSets · Practical · 6 min

    Run one copy of a pod on every node (or a selected set) for agents like log shippers and CNI plugins.

Networking

  1. Services · Essentials · 10 min

    A Service gives a set of pods one stable virtual IP and DNS name, load-balancing across the ready ones.

  2. Ingress and the Gateway API · Practical · 12 min

    Route external HTTP(S) traffic to Services by host and path with an Ingress or Gateway API resources.

  3. DNS and service discovery · Practical · 8 min

    Pods find Services by DNS names like api.shop.svc.cluster.local, served by CoreDNS.

Configuration and storage

  1. ConfigMaps and Secrets · Essentials · 10 min

    Keep configuration and credentials outside the image and inject them as environment variables or files.

  2. Volumes, PersistentVolumes and claims · Practical · 12 min

    Pods request durable storage with a PersistentVolumeClaim; a StorageClass provisions the actual disk.

  3. Kustomize overlays · Practical · 10 min

    Customise plain YAML per environment with bases, overlays and patches, built into kubectl.

Operating applications

  1. Logs, exec, events and port-forward · Essentials · 10 min

    Inspect running apps with kubectl logs, exec, describe, events, port-forward and ephemeral debug containers.

  2. Rolling updates and rollbacks · Practical · 10 min

    Ship new versions with zero downtime using the RollingUpdate strategy, and undo bad ones with rollout undo.

  3. Liveness, readiness and startup probes · Practical · 10 min

    Tell Kubernetes when a container is ready for traffic, when it is stuck, and how long it may take to start.

  4. Requests, limits and QoS · Practical · 12 min

    Requests reserve CPU and memory for scheduling; limits cap usage; together they set a pod's QoS class.

  5. Autoscaling: HPA, VPA and nodes · Advanced · 12 min

    Scale pod counts on metrics with the HorizontalPodAutoscaler, right-size requests with VPA, and add nodes automatically.

  6. PodDisruptionBudgets and node drains · Advanced · 8 min

    Keep enough replicas up during voluntary disruptions like node upgrades with PodDisruptionBudgets.

  7. Troubleshooting pods systematically · Advanced · 12 min

    Diagnose Pending, ImagePullBackOff, CrashLoopBackOff, OOMKilled and not-ready pods with a fixed routine.

Scheduling and security

  1. RBAC and service accounts · Advanced · 12 min

    Grant people and workloads exactly the API permissions they need with Roles, ClusterRoles and bindings.

  2. Scheduling: affinity, taints and spread · Advanced · 12 min

    Steer pods onto or away from nodes with node selectors, affinity, taints, tolerations and topology spread.

  3. NetworkPolicies · Advanced · 10 min

    Restrict which pods may talk to which, starting from default-deny, enforced by the CNI plugin.

  4. Pod security contexts and admission · Advanced · 10 min

    Run containers as non-root with minimal privileges, and enforce baseline or restricted standards per namespace.

Internals and extending

  1. Controllers, watches and reconciliation · Expert · 15 min

    How controllers use list-watch, informers and level-triggered reconcile loops, and why that design is resilient.

  2. CRDs and operators · Expert · 15 min

    Extend the API with CustomResourceDefinitions and automate software operations with operator controllers.

  3. API requests, admission and server-side apply · Expert · 15 min

    Follow a request through authentication, authorization, admission and etcd, and understand field ownership with server-side apply.

  4. kubelet, CRI and the pod sandbox · Expert · 14 min

    How the kubelet turns a pod spec into containers via CRI, containerd, runc, cgroups and the pause sandbox.

  5. Service networking internals · Expert · 14 min

    How kube-proxy (iptables, IPVS, nftables) or eBPF dataplanes implement ClusterIPs on top of the CNI pod network.