github kubernetes/kube-state-metrics v2.20.0

2 hours ago

v2.20.0 / 2026-08-16

Notes

Custom Resource State (CRS) metrics are now feature-frozen; no new CRS features will be accepted going forward. See #3050 for details.

  • This release builds with Go v1.26.6
  • This release builds with k8s.io/client-go: v0.36.3

Changelog

  • [CHANGE] kube_pod_status_reason now emits a row only for the reason that is actually set, instead of one zero/one row per known reason for every pod by @bhope in #3089
  • [FEATURE] Add kube_pod_status_disruption_reason metric for pods evicted via the Eviction API by @bhope in #3088
  • [FEATURE] Add MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding metrics by @mrueg in #3019
  • [FEATURE] Add ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding metrics by @mrueg in #3014
  • [FEATURE] Add HPA scale up/down behavior tolerance metrics by @emmayusufu in #3015
  • [FEATURE] Add kube_node_spec_pod_cidrs metric by @emmayusufu in #3011
  • [FEATURE] Add kube_pod_resourceclaim_info metric for DRA ResourceClaim references by @cyber-slave-labs in #3005
  • [FEATURE] Add kube_pod_init_container_status_last_terminated_exitcode metric by @emmayusufu in #3000
  • [FEATURE] Add init container state_started and last_terminated_timestamp metrics by @emmayusufu in #2997
  • [FEATURE] Shard only resource mutation watch events by @jfremy-openai in #2993
  • [FEATURE] Add label generation support for ephemeral volumes in pods by @eminaktas in #2891
  • [FEATURE] Allow wildcards in annotation and label allowlists by @skoef in #2873
  • [FEATURE] Add access mode metric for PersistentVolumes by @viragvoros in #2823
  • [ENHANCEMENT] Reduce allocations in metric generation and header sanitization by @mrueg in #3060
  • [ENHANCEMENT] Implement cache.Store Bookmark and LastStoreSyncResourceVersion in MetricsStore for client-go 0.36 compatibility by @mrueg in #2965
  • [BUGFIX] Don't panic on a Deployment with an unset rollingUpdate value by @mrueg in #3083
  • [BUGFIX] Serialize config reloads so one does not strand another instance by @mrueg in #3070
  • [BUGFIX] Rebuild clients from the current kubeconfig on reload by @mrueg in #3080
  • [BUGFIX] Check CRD fields instead of asserting them during discovery by @mrueg in #3078
  • [BUGFIX] Build each EndpointSlice hint's labels independently by @mrueg in #3076
  • [BUGFIX] Guard the store builder state shared with discovery by @mrueg in #3075
  • [BUGFIX] Read the discovery GVK cache under the lock by @mrueg in #3074
  • [BUGFIX] Scope the metrics handler scrape lock to reading the writers by @mrueg in #3073
  • [BUGFIX] Skip an HPA status metric whose source is not set by @mrueg in #3071
  • [BUGFIX] Fix three issues in the server request and shutdown paths by @mrueg in #3068
  • [BUGFIX] Escape reserved characters in metric help text by @mrueg in #3067
  • [BUGFIX] Don't panic on a custom resource metric that fails to compile by @mrueg in #3066
  • [BUGFIX] Preserve pagination metadata when filtering a sharded list by @mrueg in #3065
  • [BUGFIX] Never emit the same label name twice by @mrueg in #3064
  • [BUGFIX] Don't dereference an unset EndpointSlice port number by @mrueg in #3063
  • [BUGFIX] Write headers when only a later store has metrics by @mrueg in #3061
  • [BUGFIX] Don't emit nil metrics for unparseable pod IPs by @mrueg in #3059
  • [BUGFIX] Fix wrong labels applied to the endpointslices metric by @odinuge in #3058
  • [BUGFIX] Embed tzdata so named CronJob spec.timeZone values resolve by @SteeleND in #3022
  • [BUGFIX] Prevent leaked goroutines on CRD updates by @jfremy-openai in #3007
  • [BUGFIX] Start the zombie-process reaper only once by @mrueg in #3079
  • [BUGFIX] Emit the default suspend metric value for CronJobs by @immanuwell in #2999
  • [BUGFIX] Prevent duplicate cluster-scoped metrics when using --namespaces by @emmayusufu in #2998
  • [BUGFIX] Log when a configured custom resource CRD is absent by @aryanputta in #2996
  • [BUGFIX] Handle omitted minReplicas in HPA metrics by @immanuwell in #2991
  • [BUGFIX] Stop the CRD discoverer when its context is canceled by @L3n41c in #2977
  • [BUGFIX] Guard nil Spec.Replicas before dereferencing on Deployments by @immanuwell in #2971
  • [BUGFIX] Guard nil suspend field in CronJob next-schedule metric by @immanuwell in #2970
  • [BUGFIX] Ignore non-served CRD versions in discovery by @boomer41 in #2940
  • [BUGFIX] Skip landing page registration on NewLandingPage error by @carterpewpew in #2937
  • [BUGFIX] Log when a configured custom resource CRD is not installed in the cluster by @maksimp13 in #2903
  • [BUGFIX] Handle nil path gracefully in StateSet metrics by @Br1an67 in #2884

Full Changelog

  • fix: Update base image for post-release step by @rexagod in #2963
  • chore: Merge Release 2.19.0 back to main by @bhope in #2962
  • build(deps): Bump goreleaser/goreleaser-action from 7.2.1 to 7.2.2 by @dependabot[bot] in #2966
  • fix(cronjob): guard nil suspend in next schedule metric by @immanuwell in #2970
  • build(deps): Bump github.com/prometheus/common from 0.67.5 to 0.68.0 by @dependabot[bot] in #2976
  • chore: upgrade golang toolchain to address CVE-2026-42504 - GO-2026-5038 by @slessard in #2982
  • chore: Fix several high-scoring CVEs by @slessard in #2981
  • fix: watch-list bookmarks with sharding by @jfremy-openai in #2974
  • build(deps): Bump github.com/netresearch/go-cron from 0.14.0 to 0.15.0 by @dependabot[bot] in #2985
  • build(deps): Bump actions/checkout from 6.0.2 to 6.0.3 by @dependabot[bot] in #2983
  • build(deps): Bump github.com/prometheus/common from 0.68.0 to 0.68.1 by @dependabot[bot] in #2984
  • fix(deployment): guard nil Spec.Replicas before dereference by @immanuwell in #2971
  • chore: fix link for ksm staging image promo by @bhope in #2987
  • fix: don't panic on CronJobs with unparseable schedules by @atosatto in #2978
  • chore: Release 2.19.1 by @bhope in #2995
  • fix(discovery): Stop the discoverer when the context is canceled by @L3n41c in #2977
  • fix(hpa): handle omitted minReplicas in HPA metrics by @immanuwell in #2991
  • feat(pod): add init container state_started and last_terminated_timestamp metrics by @emmayusufu in #2997
  • fix(cronjob): emit the default suspend metric value by @immanuwell in #2999
  • feat: implement cache.Store Bookmark and LastStoreSyncResourceVersion… by @mrueg in #2965
  • feat: shard only resource mutation watch events by @jfremy-openai in #2993
  • fix: prevent duplicate cluster-scoped metrics when using --namespaces by @emmayusufu in #2998
  • build(deps): Bump actions/checkout from 6.0.3 to 7.0.0 by @dependabot[bot] in #3012
  • build(deps): Bump github.com/prometheus/common from 0.68.1 to 0.69.0 by @dependabot[bot] in #3013
  • feat: add kube_pod_resourceclaim_info metric for DRA ResourceClaim references by @cyber-slave-labs in #3005
  • feat: Implement ValidationAdmissionPolicy (VAP) metrics by @mrueg in #3014
  • feat(node): add kube_node_spec_pod_cidrs metric by @emmayusufu in #3011
  • feat(pod): add kube_pod_init_container_status_last_terminated_exitcode by @emmayusufu in #3000
  • build(deps): Bump actions/setup-go from 6.4.0 to 6.5.0 by @dependabot[bot] in #3025
  • build(deps): Bump goreleaser/goreleaser-action from 7.2.2 to 7.2.3 by @dependabot[bot] in #3029
  • build(deps): Bump github.com/prometheus/exporter-toolkit from 0.16.0 to 0.17.1 by @dependabot[bot] in #3030
  • build(deps): Bump github.com/prometheus/common from 0.69.0 to 0.70.0 by @dependabot[bot] in #3034
  • build(deps): Bump kubernetes-sigs/release-actions/setup-bom from 0.4.3 to 0.4.4 by @dependabot[bot] in #3037
  • build(deps): Bump actions/setup-go from 6.5.0 to 7.0.0 by @dependabot[bot] in #3038
  • build(deps): Bump github.com/prometheus/client_golang from 1.23.3-0.20251103151724-a5ae20370e5e to 1.24.0-rc.0 by @dependabot[bot] in #3039
  • build(deps): Bump github.com/prometheus/client_golang from 1.24.0-rc.0 to 1.24.0 by @dependabot[bot] in #3040
  • docs(pod): note pod-level resources are covered by kube-scheduler resource metrics by @emmayusufu in #3027
  • feat: add support for label generation for ephemeral volumes in pod by @eminaktas in #2891
  • fix(discovery): log when a configured custom resource CRD is absent by @aryanputta in #2996
  • build(deps): Bump actions/checkout from 7.0.0 to 7.0.1 by @dependabot[bot] in #3045
  • build(deps): Bump github.com/prometheus/client_golang from 1.24.0 to 1.24.1 by @dependabot[bot] in #3047
  • build(deps): Bump the k8s-dependencies group with 6 updates by @dependabot[bot] in #3046
  • build(deps): Bump github.com/go-logr/logr from 1.4.3 to 1.4.4 by @dependabot[bot] in #3048
  • docs: mark custom-resource-state as feature-frozen by @mrueg in #3050
  • fix: prevent leaked goroutines on CRD updates by @jfremy-openai in #3007
  • feat(hpa): add scale up/down behavior tolerance metrics by @emmayusufu in #3015
  • fix(cronjob): embed tzdata so named spec.timeZone values resolve by @SteeleND in #3022
  • feat: Add access mode metric for PersistentVolumes by @viragvoros in #2823
  • build(deps): Upgrade github.com/dlclark/regexp2 to v2 by @chimanjain in #3051
  • fix: use previous release tag for benchmark comparison instead of release branch by @bhope in #2957
  • feat: Add MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding … by @mrueg in #3019
  • fix(customresourcestate): log when configured CRD is not installed in cluster by @maksimp13 in #2903
  • build(deps): Bump github.com/netresearch/go-cron from 0.15.0 to 0.15.1 by @dependabot[bot] in #3054
  • feat: allow wildcards as part of annotations and labels in allowlists by @skoef in #2873
  • fix: fix issues with wrong labels being applied to endpointslices metric by @odinuge in #3058
  • fix(customresourcestate): handle nil path gracefully in StateSet metrics by @Br1an67 in #2884
  • fix(pod): do not emit nil metrics for unparseable pod IPs by @mrueg in #3059
  • fix: Ignore non-served CRD versions in discovery by @boomer41 in #2940
  • chore: modernize using slices, min builtin, and %w error wrapping by @mrueg in #2916
  • perf: reduce allocations in metric generation and header sanitization by @mrueg in #3060
  • fix: Skip landing page registration on NewLandingPage error by @carterpewpew in #2937
  • fix(proc): start the reaper only once by @mrueg in #3079
  • fix(endpointslice): do not dereference an unset port number by @mrueg in #3063
  • fix(discovery): read the GVK cache under the lock by @mrueg in #3074
  • fix(store): guard the builder state shared with discovery by @mrueg in #3075
  • fix(customresourcestate): do not panic on a metric that fails to compile by @mrueg in #3066
  • fix(hpa): skip a status metric whose source is not set by @mrueg in #3071
  • fix(store): never emit the same label name twice by @mrueg in #3064
  • fix(util): rebuild the clients from the current kubeconfig by @mrueg in #3080
  • fix(sharding): preserve pagination metadata when filtering a list by @mrueg in #3065
  • fix(metric_generator): escape reserved characters in help text by @mrueg in #3067
  • fix(metrics_store): write headers when only a later store has metrics by @mrueg in #3061
  • fix: three fixes in the server request and shutdown paths by @mrueg in #3068
  • fix(discovery): check the CRD fields instead of asserting them by @mrueg in #3078
  • fix(metricshandler): scope the scrape lock to reading the writers by @mrueg in #3073
  • fix(endpointslice): build each hint's labels independently by @mrueg in #3076
  • build(deps): Bump github.com/dlclark/regexp2/v2 from 2.5.2 to 2.6.0 by @dependabot[bot] in #3082
  • feat: add kube_pod_status_disruption_reason metric by @bhope in #3088
  • feat: reduce kube_pod_status_reason cardinality by @bhope in #3089
  • chore: bump golang toolchain to 1.26.6 by @mrueg in #3092
  • fix(deployment): do not panic on an unset rollingUpdate value by @mrueg in #3083
  • test(e2e): make the pod wait loop actually retry by @mrueg in #3069
  • fix: serialize config reloads so one does not strand the other by @mrueg in #3070
  • chore: Release v2.20.0 by @bhope in #3094

New Contributors

Full Changelog: v2.19.1...v2.20.0

Don't miss a new kube-state-metrics release

NewReleases is sending notifications on new releases.