Skip to content

Conversation

taylorsmithgg
Copy link

What this PR does / why we need it

This PR implements comprehensive AWS Global Accelerator support for the AWS Load Balancer Controller, addressing the feature request in issue #1572.

AWS Global Accelerator is a networking service that improves the performance of your users' traffic by up to 60% using Amazon Web Services' global network infrastructure. This implementation allows Kubernetes users to create and manage Global Accelerators through native Kubernetes resources.

Which issue(s) this PR fixes

Fixes #1572

Key Features

  • Complete CRD Implementation: New GlobalAccelerator Custom Resource Definition with comprehensive spec and status fields
  • Multi-Region Support: Configure endpoint groups across different AWS regions with traffic dial control
  • Service Integration: Automatic endpoint discovery from Kubernetes LoadBalancer services
  • Protocol Support: TCP and UDP protocols with configurable port ranges
  • Health Checks: Configurable health check settings for endpoint groups
  • Validation: Comprehensive webhook validation for all configuration aspects
  • Traffic Control: Traffic dial percentage for gradual traffic shifting between regions
  • Port Overrides: Route traffic to different ports on endpoints

Implementation Details

  • Controller: Full reconciliation logic with create, update, delete operations and proper finalizer handling
  • AWS SDK Integration: Complete integration with AWS SDK v2 Global Accelerator service
  • Webhook Validation: Input validation for listeners, endpoint groups, and service endpoints
  • RBAC: Updated permissions for Global Accelerator operations
  • Testing: Comprehensive unit tests for controller and webhook validator
  • Documentation: Complete user guide with examples and best practices

Testing

  • Unit tests pass (make test)
  • Code formatting and linting (make fmt, make vet)
  • CRD generation works (make manifests)
  • All existing tests continue to pass

Example Usage

apiVersion: elbv2.k8s.aws/v1beta1
kind: GlobalAccelerator
metadata:
  name: example-ga
spec:
  listeners:
    - protocol: "TCP"
      portRanges:
        - fromPort: 80
          toPort: 80
  endpointGroups:
    - region: "us-west-2"
      endpoints:
        - endpointID: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-alb/1234567890abcdef"

Documentation

  • Added comprehensive user guide: docs/guide/globalaccelerator/globalaccelerator.md
  • Added configuration examples: docs/examples/globalaccelerator.yaml
  • Includes IAM permissions, troubleshooting, and best practices

Files Changed

  • 20 files changed with 3,310 additions and 44 deletions
  • 9 new files created for the complete Global Accelerator implementation
  • Complete CRD with validation webhooks
  • Controller with full reconciliation logic
  • AWS SDK v2 integration
  • Service endpoint discovery
  • Comprehensive test coverage

Breaking Changes

None. This is a purely additive feature that doesn't affect existing functionality.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Aug 20, 2025
Copy link

linux-foundation-easycla bot commented Aug 20, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @taylorsmithgg!

It looks like this is your first PR to kubernetes-sigs/aws-load-balancer-controller 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-load-balancer-controller has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

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

Hi @taylorsmithgg. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 20, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 20, 2025
Implements comprehensive AWS Global Accelerator integration for the AWS Load Balancer Controller.

This adds a new GlobalAccelerator Custom Resource Definition (CRD) that allows users to:
- Create and manage AWS Global Accelerators through Kubernetes resources
- Configure listeners with TCP/UDP protocols and port ranges
- Define endpoint groups across multiple AWS regions
- Automatically discover endpoints from Kubernetes LoadBalancer services
- Control traffic distribution with dial percentages
- Configure health checks and port overrides

Key components:
- Complete CRD with validation webhooks
- Controller with full reconciliation logic
- AWS SDK v2 integration
- Service endpoint discovery
- Comprehensive test coverage
- Documentation and examples
- RBAC permissions
@taylorsmithgg taylorsmithgg force-pushed the feat/global-accelerator-support branch from 7e84fbe to 79ee771 Compare August 20, 2025 19:01
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Aug 20, 2025
@shraddhabang
Copy link
Collaborator

/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 21, 2025
@shraddhabang
Copy link
Collaborator

@taylorsmithgg Thank you for contributing this important feature. I will take a look at this. Please note that we will require an internal security review done on this before merging and releasing. I will handle that for you.

@taylorsmithgg
Copy link
Author

@taylorsmithgg: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-aws-load-balancer-controller-e2e-test 79ee771 link true /test pull-aws-load-balancer-controller-e2e-test
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

I investigated the automated test failure and found that the Gateway tests were actually being skipped, not failing. The tests are disabled by default in the CI environment.

I verified locally that the Gateway tests run properly with these Global Accelerator changes:

  • All Gateway API CRDs install correctly alongside the new GlobalAccelerator CRD
  • No conflicts with existing controller initialization or AWS service layers
  • Gateway resource creation works as expected (GatewayClass, LoadBalancerConfiguration, etc.)

The "failure" in CI occurs because:

  • Gateway tests require --enable-gateway-tests=true flag but default to false (test/framework/options.go:53)
  • Required Gateway API CRDs are not installed in the CI environment
  • When prerequisites are missing, the tests skip with [SKIPPED] Skipping gateway tests

Local verification steps:

Install project CRDs and Gateway API CRDs from our go.mod version

make install
kubectl apply -f "$(go env GOMODCACHE)/sigs.k8s.io/[email protected]/config/crd/experimental"

Run Gateway tests

cd test/e2e/gateway && go test -enable-gateway-tests=true -cluster-name= -aws-region= -aws-vpc-id=

The Global Accelerator implementation is self-contained and doesn't modify any Gateway-related code paths, so there's no risk of breaking existing functionality.

@zac-nixon
Copy link
Collaborator

Hi. The gateway failures are actually skipped. It looks like the controller isn't starting up for the service tests (but weirdly enough runs fine for the ingress tests).

The controller isn't coming up because of this error:

{"level":"error","ts":"2025-08-21T20:10:46Z","logger":"controller-runtime.source.Kind","msg":"if kind is a CRD, it should be installed before calling Start","kind":"GlobalAccelerator.elbv2.k8s.aws","error":"no matches for kind \"GlobalAccelerator\" in version \"elbv2.k8s.aws/v1beta1\""}

It's because the new CRD wasn't added to the helm CRDs list: https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/helm/aws-load-balancer-controller/crds/crds.yaml (I thought we fixed the automation to generate in both places, sorry)

@taylorsmithgg
Copy link
Author

Hi. The gateway failures are actually skipped. It looks like the controller isn't starting up for the service tests (but weirdly enough runs fine for the ingress tests).

The controller isn't coming up because of this error:

{"level":"error","ts":"2025-08-21T20:10:46Z","logger":"controller-runtime.source.Kind","msg":"if kind is a CRD, it should be installed before calling Start","kind":"GlobalAccelerator.elbv2.k8s.aws","error":"no matches for kind \"GlobalAccelerator\" in version \"elbv2.k8s.aws/v1beta1\""}

It's because the new CRD wasn't added to the helm CRDs list: https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/helm/aws-load-balancer-controller/crds/crds.yaml (I thought we fixed the automation to generate in both places, sorry)

I conducted my local testing using the CRDs from the project, as shown in my above comment.
Let me know if there's anything I can do to help!

@zac-nixon
Copy link
Collaborator

To fix the e2e tests / have our helm users be happy can you add your new crd defintiion config/crd/bases/elbv2.k8s.aws_globalaccelerators.yaml to https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/helm/aws-load-balancer-controller/crds/crds.yaml :)

Address reviewer feedback to include the new GlobalAccelerator CRD definition in the Helm chart's CRDs list to fix CI test failures.
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: taylorsmithgg
Once this PR has been reviewed and has the lgtm label, please ask for approval from shraddhabang. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Updates the Helm chart CRDs to include the new GlobalAccelerator
custom resource definition added in the Global Accelerator feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Global LoadBalancer support
4 participants