Interview Prep/Kubernetes/Storage and volumes

A ConfigMap mounted with `subPath` was updated, but the file in the running container never changes.

IntermediateTroubleshootingStorage and volumes
Answer

Likely causes → subPath mounts are bind mounts of a single file captured at container start; they never receive ConfigMap updates. Environment variables from ConfigMaps never update either.

Diagnose →

kubectl get pod web-x -o jsonpath='{.spec.containers[0].volumeMounts}' | jq '.[] | select(.subPath)'

Fix → Mount the whole ConfigMap as a directory (updates arrive within the kubelet sync period, about a minute), or roll the Pods when config changes (kubectl rollout restart, or a checksum annotation in the Helm template).

Prevent → Use a config hash annotation (checksum/config) or Kustomize generator hashes so config changes trigger rollouts.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Storage and volumes