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

Bugfix: Instances listed under maxVolumeLimits not taking into account ENIs/Instance storage #1860

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

torredil
Copy link
Member

Is this a bug fix or adding new feature?

Bugfix
closes #1688

What is this PR about? / Why do we need it?

This PR addresses a bug in the driver where the calculation that subtracts ENIs and Instance store values is bypassed for certain instance types. More specifically, instance types included in maxVolumeLimits: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/v1.21.0/pkg/cloud/volume_limits.go#L56-66.

As an example, d3.8xlarge (nitro instance) reports a value of 3: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/6f2db761cfa352e05483b7f360b4ed9053b382d6/pkg/cloud/volume_limits.go#L57C3-L57C13 even when several ENIs are attached.

Following the current logic, availableAttachments is equal to the default value of nitroMaxAttachments=28 when enis and instance store volumes are taken into account. Finally, taking the min of maxVolumeLimits and availableAttachments, the value is incorrectly set to 3.

With this change, availableAttachments is set to maxVolumeLimits if necessary before the calculation is performed so that enis and instance store volumes can be correctly taken into account.

What testing is done?

  • make test
  • Manual

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 12, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 12, 2023
Copy link

Code Coverage Diff

This PR does not change the code coverage

…t ENIs/Instance storage

Signed-off-by: Eddie Torres <torredil@amazon.com>
Signed-off-by: Eddie Torres <torredil@amazon.com>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 12, 2023
@ConnorJC3
Copy link
Contributor

/retest

1 similar comment
@ConnorJC3
Copy link
Contributor

/retest

@ConnorJC3
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2023
@ConnorJC3
Copy link
Contributor

/retest

@ConnorJC3
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ConnorJC3

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2023
@torredil
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit b5010a2 into kubernetes-sigs:master Dec 14, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Certain instance types are not calculating volume availableAttachments correctly
4 participants