How to make changes to a configmap take effect immediately without restart the pod?

Viewed 878

Imagining a MySQL application is using a configmap to store it's my.cnf file. After a modification to that my.cnf file the changes take about a minute to take effect (appearing inside the MySQL container), it's time-consuming. Is there a way to speed it up?

I tried pod annotation like sync-config-map-time":"20220210-010101, and update the annotation after a configmap modification, but this would make the application pod restarts all the time. Is there any better solution to tackle this issue?

1 Answers

Posting the answer as a community wiki, feel free to edit and expand.


Unfortunately this feature will be available in a future. You can check a progress on GitHub

At this moment I can recommend you Reloader.

We would like to watch if some change happens in ConfigMap and/or Secret; then perform a rolling upgrade on relevant DeploymentConfig, Deployment, Daemonset, Statefulset and Rollout

Reloader can watch changes in ConfigMap and Secret and do rolling upgrades on Pods with their associated DeploymentConfigs, Deployments, Daemonsets Statefulsets and Rollouts.

Related