devops/materials/01-kubernetes-primer.md
2026-01-01 00:00:00 +00:00

2.1 KiB
Raw Blame History

id title
mat-01-kubernetes-primer Kubernetes Primer

Kubernetes primer

Kubernetes background

Kubernetes is an application orchestrator that helps you:

  • deploy applications
  • scale them up/down based on demand
  • self-heal when things break
  • do rolling updates and rollbacks
  • and more

Cloud-native and microservice apps

A cloud-native app typically demands:

  • auto-scaling
  • self-healing
  • rolling updates
  • rollbacks

A microservices app typically demands:

  • lots of small, specialized, independent parts that work together
  • e.g., front-end, back-end, database, many services in a mesh

Where Kubernetes comes from

  • Early public cloud era: AWS popularized modern cloud computing
  • Google already ran large containerized apps (e.g., Search/Gmail) and developed in-house orchestration systems (Borg, Omega)
  • Kubernetes was created from those lessons and donated to the CNCF in 2014 as an open-source project

Kubernetes and Docker (historical view)

At first:

  • Docker build tools packaged apps as containers
  • Kubernetes made scheduling/orchestration decisions
  • Docker runtime was installed on each worker node

Now:

  • Kubernetes uses a container runtime layer via CRI (Container Runtime Interface)

Whats in the name (K8s)

  • “Kubernetes” is often shortened to “K8s” (“kates”)
  • “Kubernetes” comes from Greek meaning “helmsman” (the person who steers a ship)

Kubernetes from 40K feet (cluster view)

A Kubernetes cluster runs applications on:

  • control plane nodes
  • worker nodes

Control plane

The control plane is a collection of services that control and run everything. Common services:

  • API Server
  • cluster store (etcd)
  • controller manager (reconciles desired vs current state)
  • scheduler

Worker nodes

Worker nodes are where user applications run. Worker node work logic:

  • watch the API server for work assignments
  • execute work assignments
  • report back to the API server

Worker node components

  • kubelet: main agent on every worker, executes tasks and reports
  • container runtime: pulls images, starts/stops containers (via CRI; e.g., containerd)
  • kube-proxy: local networking (routing, iptables, load balancing)