Skip to content

Wrong CSI allocatable count with kubernetes metadata source #2543

@horjulf

Description

@horjulf

/kind bug

What happened?

kubernetes metadata source doesn't lookup number of ENIs or EBS volumes, leading to a wrong CSI allocatable calculation in all instances since at least an EBS block device would be attached.

Values are statically set at:
https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/pkg/cloud/metadata/k8s.go#L150

instanceInfo := Metadata{
		InstanceID:             instanceID,
		InstanceType:           instanceType,
		Region:                 region,
		AvailabilityZone:       availabilityZone,
		NumAttachedENIs:        1, // All nodes have at least 1 attached ENI, so we'll use that
		NumBlockDeviceMappings: 0,
	}

What you expected to happen?

Feature parity with IMDS metadata provider.

How to reproduce it (as minimally and precisely as possible)?

Helm chart values:

node:
  metadataSources: imds

Check allocatable count with:
kubectl get csinode <node> -o yaml

Anything else we need to know?:

Environment

  • Kubernetes version (use kubectl version): 1.33
  • Driver version: 1.45

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/activeIndicates that an issue or PR is actively being worked on by a contributor.priority/backlogHigher priority than priority/awaiting-more-evidence.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

    No branches or pull requests

    Issue actions