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

Upgrade controller-runtime to v0.15.0 #2481

Merged
merged 2 commits into from
Aug 21, 2023
Merged

Conversation

jdn5126
Copy link
Contributor

@jdn5126 jdn5126 commented Jul 27, 2023

What type of PR is this?
enhancement

Which issue does this PR fix:
#2160

What does this PR do / Why do we need it:
The main goal for this PR is to upgrade the controller-runtime module to v0.15.0 and handle all of the breaking API changes. The second goal is to use only a single Kubernetes client, i.e. remove the raw client. This, in combination with improvements in the latest controller-runtime, helps us address #2160

This PR also fixes and re-enables the IPAMD events test. The issue with the test was a mismatch between eventsv1.Events and corev1.Events.

I also took this opportunity to upgrade some other Go modules that had dependabot alerts.

When reviewing, please focus on the changes in pkg/k8sapi/k8sutils.go. The rest of the changes are either:

  1. combining clients
  2. test-only changes due to controller-runtime upgrade
  3. cleanup

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:
N/A

Testing done on this change:
I manually ran all VPC CNI integration tests and verified that they passed. I also ran the performance integration test to verify that there was no increase in memory consumption by the aws-node pod and to see the decrease in API server calls.

An integration test job will be scheduled against this PR.

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, Yes

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

Does this PR introduce any user-facing change?:
Yes

Upgrade controller-runtime to v0.15.0

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

@jdn5126 jdn5126 requested a review from a team as a code owner July 27, 2023 21:56
@jdn5126
Copy link
Contributor Author

jdn5126 commented Jul 27, 2023

@jdn5126
Copy link
Contributor Author

jdn5126 commented Jul 31, 2023

Copy link
Contributor

@jaydeokar jaydeokar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably check all the replace <packages>, maybe some of them might not be relevant..
or add a comment what dependency it is blocked on so that it can be removed when that gets updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a good call. I tried to remove the non-containernetworking ones early into this PR, but ran into issues, so I need to mark why the replaces are still needed.

if err = c.tryAllocateENI(ctx); err == nil {
c.updateLastNodeIPPoolAction()
} else {
// Note that no error is returned if ENI allocation fails. This is because ENI allocation failure should not cause node to be "NotReady".
log.Debugf("Error trying to allocate ENI: %v", err)
}
} else {
log.Debugf("Skipping ENI allocation as the max ENI limit of %d is already reached (accounting for %d unmanaged ENIs and %d trunk ENIs)",
c.maxENI, c.unmanagedENI, reserveSlotForTrunkENI)
log.Debugf("Skipping ENI allocation as the max ENI limit is already reached")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the detailed log giving the number of enis attached ? I think it will be helpful instead of looking at the instance logs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, and maybe it would be good to print in hasRoomForEni, but in general it should be easy enough to find that I figured the overhead was not worth it

@jdn5126 jdn5126 merged commit ea10123 into aws:master Aug 21, 2023
4 checks passed
@jdn5126 jdn5126 deleted the raw_client_upgrade branch August 21, 2023 15:19
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