CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Application Developer

Exposing Pod Metadata with the Downward API

The downward API injects facts about the Pod into the Pod - its name, the node it landed on, its own IP, the memory limit it was given. It comes in two forms with different capabilities, and the difference is the exam question: labels and annotations are available only through a volume, and asking for them as an environment variable is rejected with a message that helpfully lists everything that is allowed.

Configuration and Security Guide 30 of 44 Intermediate

Written against the versions above. `resourceFieldRef` takes a `divisor`, which sets the unit of the value it produces: `1m` gives millicores, `1Mi` gives mebibytes. Without it the value is in bytes and cores, which is almost never what an application wants to read.

One Pod. The node name and Pod IP it reports are the real ones the scheduler and CNI assigned.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. Seven facts through environment variables

  2. Two more through a volume

  3. The field that is not allowed as an environment variable

  4. The one that needs a container name

Official sources