Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes/OC ConfigMap vs config in git and process in container to watch for changes

I am deploying a spring boot application and is considering various options for externalize configuration. I came to know below options.

1) ConfigMap
2) properties/yaml file in Git and a process in container to watch for changes and restart the application with new properties if there are any changes.

This is not only related to application only, But can be relevant for other components as well like proxies(apache RP,nginx)/load balancers etc.

Thanks

like image 767
maverick Avatar asked Dec 20 '25 12:12

maverick


1 Answers

Both are good options to handle configuration.

Git approach has the advantage of versioned configuration but you'll need an extra container to be coded and maintained.

For me configmap is the best option. As it is a Kubernetes native object you don't need a git repo nor a git container, it is just stored and preserved in etcd, much more easy to maintain.

Moreover, there are some open source projects that can help you with using configmaps: I use kube-backup to have a versioned copy of every config,and configmapcontroller to auto-rollout deployments when a configmap changes.

like image 157
Ignacio Millán Avatar answered Dec 22 '25 22:12

Ignacio Millán



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!