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

Count volumes attached to a node #2501

Open
thommeo opened this issue Sep 18, 2024 · 1 comment · May be fixed by #2507
Open

Count volumes attached to a node #2501

thommeo opened this issue Sep 18, 2024 · 1 comment · May be fixed by #2507
Assignees
Labels
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.

Comments

@thommeo
Copy link

thommeo commented Sep 18, 2024

What would you like to be added:

  1. A gauge metric reflecting number of the persistent volumes attached to a node.

Why is this needed:

The number of volumes that can be attached to a Node is limited.

Event with higher limits e.g. with Google we can still reach them. So monitoring the number of volumes attached per node and number of volumes that can be attached per node is essential to scale out when it's required.

Describe the solution you'd like

Here is how I tried to tackle this, but apparently it is not possible and will not be possible to create custom resource states on the core objects. So this is NOT working:

        kind: CustomResourceStateMetrics
        spec:
          resources:
            - groupVersionKind:
                group: ""
                kind: Node
                version: v1
              labelsFromPath:
                node: [metadata, name]
              metrics:
                - name: node_volumes_attached_count
                  help: Number of volumes attached to the node
                  type: Gauge
                  gauge:
                    path: [status, volumesAttached]
                    valueFrom:
                      count: {}
                - name: node_volumes_in_use_count
                  help: Number of volumes in use on the node
                  type: Gauge
                  gauge:
                    path: [status, volumesInUse]
                    valueFrom:
                      count: {}

I am not sure if this max volume limit is exposed to Kubernetes by the vendors in any way, but we definitely can count the attached volumes. Knowing the given provider limitations, we can come up with the alerting strategy based on node labels and the count of the volumes that are currently attached.

@thommeo thommeo added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 18, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 18, 2024
@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 Sep 19, 2024
LiuQhahah added a commit to LiuQhahah/kube-state-metrics that referenced this issue Sep 23, 2024
@LiuQhahah LiuQhahah linked a pull request Sep 23, 2024 that will close this issue
LiuQhahah added a commit to LiuQhahah/kube-state-metrics that referenced this issue Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants