IT 3300 : Virtualization

Kubernetes — Introduction

What is Kubernetes?

Open-source system to deploy, scale, and self-heal containerized
applications across a cluster of machines.

You declare the desired state; Kubernetes works to make reality match.

Why not just Docker/Compose?

  • Compose runs an app on one host
  • What about many hosts, failover, scaling, rolling updates?
  • Kubernetes (k8s) orchestrates containers across a whole cluster

What it gives you

  • Self-healing — restarts failed containers, replaces dead ones
  • Scaling — run N replicas; scale up/down on demand
  • Load balancing — spread traffic across replicas
  • Rollouts/rollbacks — update with no downtime, undo cleanly
  • Bin packing — fit workloads onto nodes by CPU/memory

Declarative desired state

  • You describe what you want (3 replicas of this image)
  • k8s figures out how to get and keep it there
  • A control loop constantly reconciles desired vs. actual
  • Same mindset as Compose, scaled to a cluster

Cluster anatomy

  • Control plane — the brain (schedules, tracks state)
  • Worker nodes — where your containers actually run
  • You talk to the cluster with kubectl

Control plane pieces

  • API server — the front door; everything goes through it
  • etcd — the cluster's database (desired + actual state)
  • scheduler — decides which node runs a new pod
  • controller manager — runs the reconcile loops

Node pieces

  • kubelet — the agent that runs pods on the node
  • container runtime — actually runs containers
  • kube-proxy — wires up service networking

The runtime changed — important

  • Kubernetes no longer uses Docker on nodes
  • dockershim was removed in k8s 1.24
  • Nodes now run containerd (or CRI-O) via the CRI interface
  • Your Docker-built OCI images still run perfectly

Ways to run a cluster

  • k3s — lightweight, great for homelab/edge
  • MicroK8s — simple snap install, easy add-node
  • kind / minikube — local dev on a single machine
  • GKE / EKS / AKS — managed cloud (Unit 4)

Key objects (preview)

  • Pod — one or more containers, the smallest unit
  • Deployment — manages replicas, scaling, rollouts
  • Service — stable network endpoint for pods
  • ConfigMap / Secret — configuration and credentials

Lab goals

  • Read one Kubernetes case study; note the problem it solved
  • Be able to name the control-plane and node components
  • Explain, in a sentence, "declarative desired state"