Skip to content

Add support for specifying the load balancer's name via annotation #1880

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 1 commit into from
Mar 13, 2021

Conversation

rifelpet
Copy link
Contributor

This adds a new "aws-load-balancer-name" annotation that can be used to specify the associated load balancer's name, overriding the default name format.

Some implementation notes:

  • This doesn't perform any input validation on the annotation value to ensure it matches the allowed naming format. I'm happy to add this but didnt see validation on any other annotation value strings.
  • Adding or updating the annotation on existing ingresses has no effect once a load balancer already exists.
  • This doesn't modify target group names. I was wondering if another annotation would be accepted for specifying target group names. Given the one-to-many relationship of k8s Services to target groups, the annotation could be a stringMap of service ports to target group names, something like:
service.beta.kubernetes.io/aws-target-group-name: "{\"80\": \"target-group-1\", \"443\": \"target-group-2\"}"

fixes #1483

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 12, 2021
This adds a new "aws-load-balancer-name" annotation that can be used to specify the associated load balancer's name, overriding the default name format.

Some implementation notes:
* This doesn't perform any input validation on the annotation value to ensure it matches the allowed naming format. I'm happy to add this but didnt see validation on any other annotation value strings.
* Adding or updating the annotation on existing ingresses has no effect once a load balancer already exists.
@kishorj
Copy link
Collaborator

kishorj commented Mar 12, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 12, 2021
@kishorj kishorj added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Mar 12, 2021
@M00nF1sh
Copy link
Collaborator

M00nF1sh commented Mar 12, 2021

thanks for contributing this feature, really valuable 👍

for target-group-name, i wonder the use case to explicitly control it (it's also complicated when IngressGroup is involved). i think we can pending that until there is a real use case for control over targetGroup names. (For loadbalancer, the use case exists since the name impacts DNS name)

Copy link
Collaborator

@kishorj kishorj left a comment

Choose a reason for hiding this comment

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

@rifelpet, thanks for the contribution. I appreciate your efforts on the e2e tests.

@@ -48,6 +48,7 @@ type TargetGroupHC struct {
}

type LoadBalancerExpectation struct {
Name *string
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: for consistency, string instead of a pointer looks better to me

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Mar 13, 2021
@kishorj
Copy link
Collaborator

kishorj commented Mar 13, 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 Mar 13, 2021
@k8s-ci-robot k8s-ci-robot merged commit 0fac200 into kubernetes-sigs:main Mar 13, 2021
@alexmnyc alexmnyc mentioned this pull request Apr 22, 2021
Timothy-Dougherty pushed a commit to adammw/aws-load-balancer-controller that referenced this pull request Nov 9, 2023
…ubernetes-sigs#1880)

This adds a new "aws-load-balancer-name" annotation that can be used to specify the associated load balancer's name, overriding the default name format.

Some implementation notes:
* This doesn't perform any input validation on the annotation value to ensure it matches the allowed naming format. I'm happy to add this but didnt see validation on any other annotation value strings.
* Adding or updating the annotation on existing ingresses has no effect once a load balancer already exists.
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/L Denotes a PR that changes 100-499 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.

[Feature Request] Add the option to specify a load balancer name
4 participants