aws-load-balancer-controller icon indicating copy to clipboard operation
aws-load-balancer-controller copied to clipboard

Add `load-balancer-name-prefix` annotation

Open hfern opened this issue 9 months ago • 9 comments

Issue

Description

This adds a alb.ingress.kubernetes.io/load-balancer-name-prefix annotation. This is useful for being able to control the name of the created load balancer without needing to specify a fully unique name.

We have several similar clusters in one AWS account, all with similar namespace/resources. This leads to this situation, where it's hard to tell at a glance (without digging into tags) which load balancer goes to which cluster:

image

Already the ALBC will provide uniqueness for you if you do not specify a name. This is nice because you can be reasonable certain there will be no name collisions. That means you can copy/paste (and we can vend) a static piece of yaml into different clusters or namespaces IF you do not specify the load-balancer-name.

However, if you want to get more descriptive with the name via load-balancer-name, now you need to worry about collision (even potentially with resources in other clusters).

load-balancer-name-prefix is a happy middle ground where you can be more specific without having to own avoiding naming collisions.

Checklist

  • [x] Added tests that cover your change (if possible)
  • [x] Added/modified documentation as required (such as the README.md, or the docs directory)
  • [x] Manually tested - make test and reviewed generated docs so they look right
  • [x] 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?! :exploding_head:

  • [ ] Backfilled missing tests for code in same general area :tada:
  • [x] Refactored something and made the world a better place :star2:

hfern avatar May 08 '24 22:05 hfern

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hfern Once this PR has been reviewed and has the lgtm label, please assign m00nf1sh for approval. For more information see the Kubernetes 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

k8s-ci-robot avatar May 08 '24 22:05 k8s-ci-robot

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: hfern / name: Hunter Fernandes (96f6f67aa845de886dae770c9ce8d824e43fccd0, f69268cfa12b628669fccd7f08f4f0fb2f146034, dbb26ff935f0c6e51582a4f030a0c6dd96792e8c, 0dcac0c7a57cf0e5a53efdbfb6fd34f0445ce32f)

Welcome @hfern!

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. :smiley:

k8s-ci-robot avatar May 08 '24 22:05 k8s-ci-robot

Hi @hfern. 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 avatar May 08 '24 22:05 k8s-ci-robot

Thanks for the contribution, and sorry for the delay. I left some minor comments. Also, can you please add an e2e test to ingress?

oliviassss avatar May 21 '24 22:05 oliviassss

@oliviassss thanks for taking a look at this -- I added an e2e test that exercised the prefix annotation and addressed the other PR comments. Can you take another look when you get a chance?

hfern avatar May 24 '24 18:05 hfern

PR needs rebase.

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 avatar May 31 '24 11:05 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 29 '24 12:08 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Sep 28 '24 12:09 k8s-triage-robot