Reload kube-state-metrics when kubeconfig changes. #2120
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/feature
Categorizes issue or PR as related to a new feature.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
What would you like to be added:
The
kube-state-metrics
server takes the--kubeconfig
argument. This argument allows passing a path to the kube-config file. When the kubeconfig file changes, the server doesn't automatically reload and we need to reload the server manually (or with hacky reload logic which we have to maintain downstream). If there were a way for the server to listen to a change in the kube-config file, then we wouldn't have to write any custom reload logic.Why is this needed:
As good security measure, kubeconfig files should be short-lived and renewed periodically. Since kube-state-metrics takes a custom configuration file options, it would be really great if kube-state-metrics updates when the kube-config file changes.
Describe the solution you'd like
I have noticed that KSM already has a watcher for the
--config
file option (where it is trying to listen to the change in the file), Can a similar pattern be implemented for a--kubeconfig
option ?Additional context
The text was updated successfully, but these errors were encountered: