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

Handle private IP exceeded error (#2210) #2253

Merged
merged 2 commits into from
Feb 7, 2023

Conversation

jayanthvn
Copy link
Contributor

  • Handle private IP exceeded error

  • Check for err when adding extra 1 IP

What type of PR is this?
Cherry-pick

Which issue does this PR fix:
#2210

What does this PR do / Why do we need it:
With 1.11.4 we optimized to reduce the number of EC2 calls - #1975.

But this introduced a regression when PrivateIPAddressLimitExceed error is returned in a corner case. I.e, If IMDS goes out of sync and aws-node restarts then IPAMD DS will have the ENI but will be missing IPs since IMDS is out of sync. Reconciler will try allocate IPs but EC2 will return PrivateIpAddressLimitExceeded since from EC2 point of view IPs are allocated. With PrivateIpAddressLimitExceeded we used to return without an error since we will verify the actual state by calling EC2 to see what addresses have already assigned to this ENI. Pre-1.11.4, IPAMD used to make a call to EC2 to confirm the actual state - https://github.com/aws/amazon-vpc-cni-k8s/blob/v1.11.3/pkg/ipamd/ipamd.go#L946

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:
In this PR, we will revert to old behavior but make EC2 call only when PrivateIpAddressLimitExceeded

Testing done on this change:

Testing will be re-run as part of release.

Automation added to e2e:

N/A
Will this PR introduce any new dependencies?:

No

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No

Does this change require updates to the CNI daemonset config files to work?:

No

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

* Handle private IP exceeded error

* Check for err when adding extra 1 IP
@jayanthvn jayanthvn requested a review from jdn5126 February 6, 2023 19:36
@jayanthvn jayanthvn requested a review from a team as a code owner February 6, 2023 19:36
@jayanthvn jayanthvn added this to the v1.12.3 milestone Feb 6, 2023
jdn5126
jdn5126 previously approved these changes Feb 6, 2023
@jdn5126 jdn5126 merged commit be518f3 into aws:release-1.12 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants