Skip to content

EndpointSlice support for IP target groups #2169

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

Merged
merged 5 commits into from
Sep 20, 2021

Conversation

harivall
Copy link
Contributor

@harivall harivall commented Aug 11, 2021

Description

Added support for EndpointSlices for TargetGroupBindings/pod endpoint resolution for IP targets!

Components added:

  • new event handler for EndpointSlices, unit tests
  • method for pod endpoint resolution from EndpointSlices, unit tests
  • command line flag for enabling the use of EndpointSlices. Based on this flag:
    • conditional use of Endpoints vs. EndpointSlices event handlers in TGB controller
    • conditional use of Endpoints vs. EndpointSlices pod endpoint resolution methods in TGB resource manager
  • update aws-load-balancer-controller-role to be able to access EndpointSlices

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 11, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @harivall. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 11, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2021

Codecov Report

Attention: Patch coverage is 66.10169% with 20 lines in your changes missing coverage. Please review.

Project coverage is 53.29%. Comparing base (2a1a0a3) to head (eaa723f).
Report is 551 commits behind head on main.

Files with missing lines Patch % Lines
pkg/backend/endpoint_resolver.go 81.25% 5 Missing and 4 partials ⚠️
pkg/targetgroupbinding/resource_manager.go 0.00% 9 Missing ⚠️
pkg/config/controller_config.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2169      +/-   ##
==========================================
+ Coverage   53.18%   53.29%   +0.11%     
==========================================
  Files         135      135              
  Lines        7446     7503      +57     
==========================================
+ Hits         3960     3999      +39     
- Misses       3178     3192      +14     
- Partials      308      312       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kishorj
Copy link
Collaborator

kishorj commented Aug 11, 2021

@harivall, thanks a lot for your contribution.

Please document the following tests in the description

  • Scale deployment to at least 1000 replicas, check the endpoint slices, verify the target group got updated as expected for both ALB and NLB
  • Specify at least 5 ports in the service spec, verify NLB gets provisioned with the listeners and target groups get populated as expected
  • Create an app deployment, wait until the target group reconcile is complete and targets are healthy, then induce readiness probe failure in half of the replicas. Verify target group gets reconciled as expected. When the readiness check pass again, target group should be updated.
  • Induce liveness check failure, and the container gets restarted. Verify the behavior.
  • Setup pod readiness gate on a namespace, verify all endpoints get registered as expected. Also verify endpoints with container in not-ready state.
  • Run the e2e tests on your cluster and make sure all the e2e tests pass
    • ginkgo -v -r test/e2e -- --kubeconfig=$KUBECONFIG --cluster-name=<Cluster_name> --aws-region=<region> --aws-vpc-id=<vpc_id>
  • Verify upgrade works as expected. For example, create ALB/NLB with the old controller version (or with endpoint slices disabled), then upgrade to the new controller version (or enable endpoint slices). Existing ALB/NLB target group should continue to work as expected.

@@ -77,6 +77,14 @@ rules:
verbs:
- patch
- update
- apiGroups:
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to specify this via the kube-builder annotation. Please refer to the following

// +kubebuilder:rbac:groups="",resources=endpoints,verbs=get;list;watch

Once you specify the kubebuilder annotation, make generate will automatically generate this file

@kishorj
Copy link
Collaborator

kishorj commented Aug 13, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 13, 2021
@harivall harivall changed the title EndpointSlice support EndpointSlice support for IP target groups Aug 13, 2021
@kishorj kishorj added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Aug 16, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: harivall, kishorj

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 Sep 10, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2021
@kishorj
Copy link
Collaborator

kishorj commented Sep 20, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 20, 2021
@k8s-ci-robot k8s-ci-robot merged commit 2e67bb6 into kubernetes-sigs:main Sep 20, 2021
Timothy-Dougherty pushed a commit to adammw/aws-load-balancer-controller that referenced this pull request Nov 9, 2023
* Add support for EndpointSlices in tgb controller, tgb resource manager, and pod endpoint resolver; add EndpointSlices event handler; add flag to enable/disable using EndpointSlices; update rbac role

* remove unnecessary logs, change endpointslices flag name, clean up code

* clean up code

* fix flag description

* fix formatting

Co-authored-by: Kishor Joshi <[email protected]>
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants