Recognize instance-type node label when EC2 metadata isn't available #1060
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Is this a bug fix or adding new feature?
/kind bug
What is this PR about? / Why do we need it?
This fixes volume limits on nodes that dont have the EC2 metadata endpoint available.
kOps is experiencing volume limit test failures and I believe this is because the limit is being set incorrectly.
The nodes are t3.mediums which should have a limit of 28 volumes.
The csi-node pod logs report that ec2 metadata is not available so we fallback to the metadata from the k8s API which doesn't set an instance type.
The volume limit code doesn't match the nitro regex and then defaults to the non-nitro limit of 39 volumes which is higher than the t3.medium's actual limit of 28:
aws-ebs-csi-driver/pkg/driver/node.go
Lines 681 to 691 in edb4fbe
The test output confirms that it incorrectly uses a limit of 39 volumes:
Sep 12 01:37:14.436: INFO: Node ip-172-20-34-51.ap-northeast-2.compute.internal can handle 39 volumes of driver ebs.csi.aws.com
What testing is done?