Skip to content

Chapter 12 · Initiate Tutorials

Kubernetes Primer

A calm, technically accurate foundation: the objects, the mental models, and the reasons they exist.

What Kubernetes is

A declarative system that converges toward desired state.

Kubernetes is an orchestration platform for running containers. Its defining trait is declarative intent: you declare what you want (desired state), and the system continuously tries to make reality match it.

That continuous convergence is why Kubernetes can self-heal: if a Pod dies, controllers recreate it; if a node disappears, workloads can be rescheduled; if replicas drift, the control plane works to restore them.

Cluster

A control plane plus a set of worker nodes.

A Kubernetes cluster is the whole system: the control plane (API server, etcd, controllers, scheduler) and the worker nodes where Pods run.

See your cluster contexts

shell

kubectl config get-contexts
kubectl config current-context

Node

A machine that runs Pods.

A node is a VM or physical machine registered into the cluster. Nodes run a container runtime and the kubelet, which talks to the control plane and ensures containers are running as instructed.

List nodes

shell

kubectl get nodes -o wide

Pod

The smallest schedulable unit in Kubernetes.

A Pod is one or more tightly coupled containers that share a network namespace and can share storage. Pods are ephemeral: you don’t typically manage individual pods directly in production.

List pods

shell

kubectl get pods -A
kubectl get pods -n default

Deployment

A controller for stateless workloads.

A Deployment manages ReplicaSets, which manage Pods. Deployments provide rollouts, rollbacks, and a stable intent: “run N replicas of this template.”

Service

Stable addressing for ephemeral Pods.

A Service gives you a stable IP/DNS name and routes to a changing set of backends (Pods). It relies on labels/selectors and endpoint data.

Ingress

A controlled gate for HTTP(S) traffic into the cluster.

An Ingress defines HTTP routing rules, but it requires an Ingress Controller(like NGINX Ingress or Traefik) to actually enforce them. Ingress is not “built-in routing magic”—it’s a contract interpreted by a controller.