Skip to content
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

feat: #2501 Count volumes attached to a node #2507

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LiuQhahah
Copy link

What this PR does / why we need it:

Count volumes attached to a node

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)

increaser two metrics: kube_node_volumes_attached_count and kube_node_volumes_in_use_count

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2501

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 23, 2024
@k8s-ci-robot k8s-ci-robot requested a review from mrueg September 23, 2024 12:19
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 23, 2024
@LiuQhahah LiuQhahah changed the title #2501 Count volumes attached to a node feat: #2501 Count volumes attached to a node Sep 23, 2024
@mrueg
Copy link
Member

mrueg commented Sep 23, 2024

I understand what you're trying to achieve here, I wonder though if it would be easier to attach a node label to the kube_volumeattachment_status_attached metric or a similar one and then do a sum by that label in promql instead of exposing counts here.

@LiuQhahah
Copy link
Author

I understand what you're trying to achieve here, I wonder though if it would be easier to attach a node label to the kube_volumeattachment_status_attached metric or a similar one and then do a sum by that label in promql instead of exposing counts here.

Thanks for the suggestion, from my understanding @thommeo wants to get the number of volumns currently attached from the perspective of node, and kube_volumeattachment_status_attached is from volumnattachment from volumeattachments to count the number of volumns he is attached to by that node attchment.

From my personal understanding and implementation point of view, I think creating a metric will be better understood, the current implementation is not so complex, so that the use of the customer will be more convenient!

@dgrisonnet
Copy link
Member

/triage accepted
/assign

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 3, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 5, 2024
…node

# Conflicts:
#	internal/store/node_test.go
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LiuQhahah
Once this PR has been reviewed and has the lgtm label, please ask for approval from dgrisonnet. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Count volumes attached to a node
4 participants