Steps to reproduce a changing configmap mounted as a volume to see the effects on a running pod.
- Create the initial config map:
Note: Above removes the creation timestamp so that subsequent applies don't trigger a change to the configmap.
kubectl create configmap my-cm --from-file configmap.txt --dry-run --output yaml | \ grep -v creationTimestamp | \ kubectl apply -f -
- Launch a simple pod with the configmap mounted as a volume:
kubectl apply -f pod.yaml
- Shell into the pod (may have to wait for it to come up):
kubectl exec -it my-pod -- /bin/sh
- Monitor the contents of the configmap file:
while $(true); do echo $(date) $(md5sum /etc/my-cm-volume/configmap.txt); sleep 1; done
- Mutate the contents of the file.
- Apply the configmap again (redo step 1).