Bird
0
0

You have a deployment using a ConfigMap for environment variables. After updating the ConfigMap, you want all pods to use the new values without downtime. What is the best approach?

hard📝 Workflow Q15 of 15
Kubernetes - ConfigMaps
You have a deployment using a ConfigMap for environment variables. After updating the ConfigMap, you want all pods to use the new values without downtime. What is the best approach?
AUpdate the ConfigMap and wait; pods auto-refresh environment variables
BDelete all pods manually to force recreation with new ConfigMap
CUpdate the ConfigMap and run <code>kubectl rollout restart deployment/myapp</code>
DEdit each pod to mount the new ConfigMap version
Step-by-Step Solution
Solution:
  1. Step 1: Understand environment variable update behavior

    Pods do not auto-refresh environment variables from ConfigMap updates.
  2. Step 2: Use rollout restart for zero downtime update

    Rolling restart updates pods one by one, applying new ConfigMap values without downtime.
  3. Final Answer:

    Update the ConfigMap and run kubectl rollout restart deployment/myapp -> Option C
  4. Quick Check:

    Rollout restart updates pods gracefully = A [OK]
Quick Trick: Use rollout restart for zero downtime ConfigMap update [OK]
Common Mistakes:
  • Expecting pods to auto-refresh env vars
  • Deleting pods causing downtime
  • Editing pods directly which is not recommended

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes