I see there’s a bit of conversation about this here Restart pods when configmap updates in Kubernetes? - Stack Overflow and in the kubernetes issue here: Facilitate ConfigMap rollouts / management · Issue #22368 · kubernetes/kubernetes · GitHub
Assuming I have a deployment that mounts a volume
from a config map or uses envFrom
using a configmap, how can I ensure that my deployment gets recreated when the underlying config map changes?
Example
Some fields omitted for brevity / clarity. How can I ensure when the ConfigOption changes that the Deployment gets updated?
---
apiVersion: v1
kind: ConfigMap
metadata:
name: appconfig
data:
DATABASE_URL: {{repl ConfigOption "db_url"}}
---
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: myapp
image: mycompany/myapp:1.0.0
envFrom:
- configMap:
name: appconfig