-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Add access mode metric for PersistentVolumes #2823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add access mode metric for PersistentVolumes #2823
Conversation
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: viragvoros The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This issue is currently awaiting triage. If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Welcome @viragvoros! |
Expose a kube_persistentvolume_access_mode metric that mirrors the existing PVC access mode metric. This allows consumers to filter and aggregate PersistentVolumes by access mode directly, without having to scrape kube_persistentvolumeclaim_access_mode. Using a small set of access-mode labels keeps cardinality low while still allowing PV metrics to be sliced by access mode. Signed-off-by: vvoeroes <[email protected]>
2b6ab10 to
17c531d
Compare
What this PR does / why we need it:
This PR adds a
kube_persistentvolume_access_modemetric that exposes the access modes ofPersistentVolumeobjects, in a way that mirrors the existing PVC access mode metric.At the moment, if we want to filter or aggregate PersistentVolumes by access mode (e.g.
ReadWriteOnce,ReadWriteMany,ReadOnlyMany), we have to rely onkube_persistentvolumeclaim_access_modeand join throughPVC metrics. That forces us to scrape the PVC access mode metrics even when we only care about PVs, and increases metric cardinality.
By exposing a dedicated PV access mode metric with a small label set, we can:
otherwise needed,
while still keeping metric cardinality low.
Details of the change
kube_persistentvolume_access_modemetric in the PV store:access_modelabel uses the standard Kubernetes accessmodes (
ReadWriteOnce,ReadOnlyMany,ReadWriteMany, etc.)internal/store/persistentvolume_test.goHow does this change affect the cardinality of KSM:
Previously, dashboards and alerts that needed PV access mode information had to join against PVC access mode metrics and therefore scrape
kube_persistentvolumeclaim_access_mode, which may have higher cardinality in large clusters.With
kube_persistentvolume_access_mode, users can query PV access modes directly from the PV metrics.