📦 Core Kubernetes Concepts

Core Kubernetes Concepts: Pod — The Smallest Unit A Pod is the shipping container itself (the physical box, not the Docker concept) — the Docker container is the goods packed ins

Pod — The Smallest Unit

A Pod is the shipping container itself (the physical box, not the Docker concept) — the Docker container is the goods packed inside it. One Pod usually wraps one container, but can hold multiple containers that need to share network and storage, like a main app and a logging sidecar riding in the same box. So why does Kubernetes wrap containers in an extra layer (the Pod) instead of scheduling Docker containers directly? Because some things genuinely need to be scheduled, networked, and scaled together as one atomic unit — a sidecar that ships logs has no reason to exist on a different node than the app it's logging. It's the same reasoning behind a Java service bundling tightly-coupled helper threads into one process instead of deploying them as separate independently-scheduled services. The QA-relevant gotcha: containers WITHIN one Pod share localhost networking, so a test that assumes 'each container needs its own service to be reachable' will write unnecessary Service objects — and a Pod restart kills every container inside it together, not just the one that crashed.

Micro Lab: Kubernetes YAML manifest repair

Replace the TODO line with the critical line from the expected solution. This is not a real runtime; the goal is to reinforce writing the correct structure in a controlled way.

What Exactly Happens in the Cluster When This Minimal YAML Is Applied?

apiVersion + kind identify it

The API Server looks at these two fields to decide WHICH controller handles the request — here, simply "Pod".

labels enable future discovery

The `app: my-app` label does nothing right now, but it is the ONLY way a future Service will FIND this pod.

image is pulled and run

`nginx:1.25` is PULLED by the container runtime and started as a container — this is the Pod's only job.

requests/limits bound resources

requests tells the scheduler "reserve at least this much", limits sets the ceiling the pod will never EXCEED.

It does not self-heal