A Pod specification consumes the same ConfigMap in two different ways: the full ConfigMap is mounted at "/etc/app/conf" (no subPath), and several keys are also injected into the container by means of envFrom. After you apply an updated version of the ConfigMap, the files inside "/etc/app/conf" change within about a minute, yet the environment variables inside the still-running container keep their original values. Which statement best explains this behavior?
Any change to a ConfigMap automatically triggers the kube-controller-manager to recreate affected Pods, so both files and environment variables should have updated; the difference indicates a failed health probe.
ConfigMaps are treated as immutable while a Pod is running; neither volume mounts nor environment variables can update until the Pod is manually deleted.
The kubelet refreshes a ConfigMap that is mounted as a volume, but environment variables sourced from that ConfigMap are fixed at container start-up, so they remain unchanged until the Pod is restarted.
Environment variables sourced from a ConfigMap are refreshed every kubelet sync cycle, whereas files from the same ConfigMap stay static unless the Deployment is rolled.
When a ConfigMap is mounted as a volume, the kubelet periodically checks the API server and rewrites the projected files, so running containers see those files change without any restart. By contrast, values that were copied from the same ConfigMap into environment variables are evaluated only once, when the container process starts. Because the container was not restarted after the ConfigMap changed, its environment block still contains the old values. The observed difference therefore reflects the designed update mechanics of ConfigMaps rather than a failure in Kubernetes.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a ConfigMap in Kubernetes?
Open an interactive chat with Bash
Why do ConfigMap environment variables not update in a running container?
Open an interactive chat with Bash
How does Kubernetes ensure ConfigMap volumes are updated dynamically?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access