liveBook · Manning

Pod

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

The smallest deployable unit in Kubernetes, containing one or more containers that share networking and storage contexts.

A pod is Kubernetes’ smallest deployable unit. It contains one or more containers and runs on a node. Deployments manage ReplicaSets, which run pods; the kubelet on each node runs containers and reports their health. When an application needs placing, connecting, storing data, or troubleshooting, the pod is the unit to inspect. section 1.4.1 section 9.3.1

Match the task to the pod setting or command:

  • Placement: the scheduler assigns a pod to a node after checking available resources. Label a node with `kubectl label no kind-worker disktype=ssd`, then set `spec.nodeSelector` to `disktype: ssd` in the pod manifest. Check the result with `kubectl get po -o wide`; its NODE column should show `kind-worker`. section 4.1
  • Connectivity: use a Service name to reach another workload. From a pod in a different namespace, qualify the name with its namespace: `curl apache-svc` fails in the example, while `curl apache-svc.default` succeeds. Inspect `/etc/resolv.conf` inside the pod for DNS search domains and the nameserver. section 6.2.4
  • Storage: create a persistent volume claim and mount it in a pod. A practice task pairs an `nginx` pod with a claim for 39 MB and mounts it at `/usr/nginx/www/html`. section 7.3.1
  • Troubleshooting: start with `kubectl get po`. For a multi-container pod, use `kubectl logs POD -c CONTAINER` to select the container, or `kubectl logs POD --all-containers` to see both. Use `kubectl describe po POD` to inspect a startup error and its events. section 8.1.1
root@kind-control-plane:/# kubectl get po -o wide
NAME      READY   STATUS    RESTARTS   AGE   IP           NODE          
NOMINATED NODE   READINESS GATES
ssd-pod   1/1     Running   0          25s   10.244.1.2   kind-worker   
<none>           <none>

The wide pod listing verifies more than a Running status: its NODE column confirms that the node selector placed `ssd-pod` on `kind-worker`. section 4.1

Diagnose a container that will not start

A pod shown as `RunContainerError` needs more than another status check. Run `kubectl describe po brick`: the example’s container state reports that its command was treated as an executable that could not be found in `$PATH`. Inspect the command in the pod manifest before retrying. section 8.1.1

Remember the scheduling exception for exam tasks: static system pods on a control-plane node are not managed by the scheduler. Their manifests live under `/etc/kubernetes/manifests`, where the kubelet starts them. For ordinary pods, check node labels and scheduling rules before assuming a placement problem is a container problem. section 9.3.1 section 9.3.3

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Defines the pod and works through placement, DNS, and log checks without descending into container-runtime internals.
Examples
Demonstrates an SSD node selector, cross-namespace curl requests, a mounted claim exercise, and multi-container log commands.
What it assumes
Assumes access to a Kubernetes cluster while showing how to generate pod YAML and inspect nodes with kubectl.
What you can do after
Operate/configure it with kubectl and YAML, then verify placement, test DNS, and diagnose container startup errors.
How it connects
Connects pods to nodes, the scheduler, Deployments, ReplicaSets, Services, DNS, persistent volume claims, and the kubelet.

Also explained in

Compare how 15 books explain pod →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.