Study. uk . com
  1. Home
  2. All questions
  3. Question 749

CKA study material · question 749 of 1000

A Pod reads a Service's address from the injected environment variables, but the variables are missing. What is the most likely reason?

  1. The Service is headless
  2. The Service was created after the Pod started
  3. The Pod uses hostNetwork
  4. The Service is in a different namespace, so DNS must be used
Show the answer

Answer: B. The Service was created after the Pod started

The kubelet injects variables only for Services that already exist when the Pod starts, which is why DNS is the dependable discovery mechanism and ordering matters for the variable approach.

Source: Service (Kubernetes) — Discovering services › Environment variables

Challenge yourself on this topic → Study as cards