Skip to content

Count volumes attached to a node #2501

Open
@thommeo

Description

@thommeo

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.

Activity

added
kind/featureCategorizes issue or PR as related to a new feature.
on Sep 18, 2024
added
needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.
on Sep 18, 2024
dgrisonnet

dgrisonnet commented on Sep 19, 2024

@dgrisonnet
Member

/triage accepted
/assign

added
triage/acceptedIndicates an issue or PR is ready to be actively worked on.
and removed
needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.
on Sep 19, 2024
added a commit that references this issue on Sep 23, 2024

kubernetes#2501 Count volumes attached to a node

added a commit that references this issue on Sep 23, 2024

kubernetes#2501 add documented

added a commit that references this issue on Nov 12, 2024

Merge branch 'main' into kubernetes#2501-Count-volumes-attached-to-a-…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @thommeo@k8s-ci-robot@dgrisonnet

    Issue actions

      Count volumes attached to a node · Issue #2501 · kubernetes/kube-state-metrics