Commit Graph

7 Commits

Author SHA1 Message Date
yshngg 141c1f05bc changes for continuing to run when file doesnt exist 2025-08-19 09:45:35 -07:00
Manuel Rüger 3b21633bee chore: Port away from gopkg.in/yaml.v3
This is deprecated by upstream and we can use sigs.k8s.io/yaml now.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2025-04-22 10:58:08 +02:00
opeco17 7bf825d989 feat: hot reload kubeconfig 2023-08-29 01:19:45 +00:00
Manuel Rüger fa5346405a Use structured logging 2023-01-27 17:35:26 +01:00
Manuel Rüger 06268ab5ef Reload CustomResourceState Config File on Change
This change adds hot reloading support for the customresourcestate
config file.

It also resolves a bug in which the customresourcestate config file was
included in the ksm config file, in which it did not get detected.

It also resolves a bug in which customresourcestatemetrics were not
added when set resources were non-default resources.

Fixes: https://github.com/kubernetes/kube-state-metrics/issues/1892
2023-01-09 17:32:09 +01:00
Manuel Rüger ee891760b8 Add metrics for config file changes
This uses code pieces from prometheus/alertmanager in https://github.com/prometheus/alertmanager/blob/main/config/coordinator.go#LL56C26-L56C26
licensed under Apache-2.0.

kube_state_metrics_config_hash{type="config", filename="config.yml"} 4.0061079457904e+13
kube_state_metrics_config_last_reload_success_timestamp_seconds{type="config", filename="config.yml"} 1.6697483049487052e+09
kube_state_metrics_config_last_reload_successful{type="config",
filename="config.yml"} 1

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-12-02 15:41:57 +01:00
Pranshu Srivastava f8360a8903
Add end-to-end testing to verify hot-reloading
Add end-to-end testing to verify hot-reloading for event-based changes
stemming from the config file. Also,
* sent in a doc fix that was missed
earlier:
https://github.com/kubernetes/kube-state-metrics/pull/1890/files#diff-380eca5a922c0ddbf67f04daefc6823e7ef0e197434d3a826d39c7063cdfa6d6R15,
* updated fsnotify and viper dependencies (v1.6.0 and v1.14.0
  respectively).

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-16 20:26:22 +05:30