2019年11月13日星期三

Kubernetes Pod refreshed along with ConfigMap

Typically an application's code will be running in a pod while its configuration stays in a ConfigMap. If the configuration is consumed as a file instead of a bunch of environment variables, it will be updated when the relevant ConfigMap changes. How should the application be notified then?

The application could always implement something like a "/reload" endpoint so that the new config is recognized. Another deployment pattern could also be considered as a common solution, which binds the ConfigMap to the pod and forces the update:

https://blog.questionable.services/article/kubernetes-deployments-configmap-change/


Update: Combined with a "/reload" endpoint, this provides a nice instrumenting sidecar for automatic reload of new configurations from ConfigMap volumes.

没有评论:

发表评论