ConfigMap Volume Auto-Update with Mounted Files
What you'll learn: How Kubernetes automatically refreshes mounted ConfigMap files in running Pods and what timing to expect.
The Auto-Update Magic
When you mount a ConfigMap as a volume (as you learned in lesson 1251), Kubernetes does something helpful: it automatically updates the files inside your running Pods when the ConfigMap changes. You don't need to restart the Pod!
This is different from ConfigMap environment variables (lesson 1250), which remain frozen at the values they had when the Pod started.
How It Works
The kubelet (the agent running on each node) periodically checks if mounted ConfigMaps have changed. When it detects a change, it updates the files inside the volume mount. Think of it like a librarian who checks for new editions of books and swaps them out while you're still reading in the library—you can pick up the updated version without leaving.
Timing Considerations
The update isn't instant. By default, kubelet checks for ConfigMap changes based on its sync period (typically 60 seconds plus the cache propagation delay). This means:
- Changes can take 1-2 minutes to appear in your Pod
- All keys in the ConfigMap update atomically (all at once)
- Your application must re-read the files to see changes—Kubernetes updates the file, but your app decides when to load it
Note: If you mounted a specific key using subPath, that file will not auto-update. Only full volume mounts get this feature.
Key Takeaway: Mounted ConfigMap volumes auto-update within 1-2 minutes via kubelet's sync cycle, but your application must actively re-read the files to pick up changes—and subPath mounts don't update at all.