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

[Feature] ability to configure target group names #2553

Open
guillaumecle opened this issue Mar 15, 2022 · 44 comments
Open

[Feature] ability to configure target group names #2553

guillaumecle opened this issue Mar 15, 2022 · 44 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@guillaumecle
Copy link

#870 and #1899 added the ability to configure the load balancer names with the alb.ingress.kubernetes.io/load-balancer-name annotation.

It would nice to also be able to configure the name of target groups. It could use the same annotation or a dedicated one.

@guillaumecle guillaumecle changed the title ability to configure target group names [Feature] ability to configure target group names Mar 15, 2022
@kishorj
Copy link
Collaborator

kishorj commented Mar 16, 2022

@guillaumecle, how do you intend to configure the target group names? The target groups are based on the backend service, and it can be shared across multiple ingresses. The target group name format is k8s--- and contain the aws tags to uniquely identify the resource. In addition you can configure specific tags per service which will be reflected in the target group tags.

What is your use case for a custom target group name?

@guillaumecle
Copy link
Author

Our target names currently look like k8s-namespac-mysupers-2eb7cacf16.
In many cases, 8 is not enough character to properly identify the service.
I would do something like this my-super-service-doing-great-things

I was thinking of using an annotation on the ingress. In case there are multiple ingresses using the same target group, it would reject the custom name (fallback on the default) or error out or pick one of the provided names (similar to the handling of load-balancer-name in case of shared load balancer)
For the unique id, could it be possible to store it in a aws tag? how does it works for load balancer name?

My primary goal is to get more human readable/searchable target group name in cloud watch metrics, alb access logs and even just when browsing the list of target groups.

@kishorj
Copy link
Collaborator

kishorj commented Apr 20, 2022

@guillaumecle, we use tags to identify target groups/load balancer resources, so the name doesn't matter to the controller. However, controller needs to ensure the name is unique. We can support annotation to specify a target name prefix via annotation on the service/ingress, and use the prefix+hash to make the target group name unique. Would this proposal satisfy your requirement?

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 20, 2022
@guillaumecle
Copy link
Author

I think that would work for us. Thanks.

@k8s-triage-robot
Copy link

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

This bot triages issues and 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 issue is closed

You can:

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

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

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 20, 2022
@guillaumecle
Copy link
Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 25, 2022
@karthichu
Copy link

+1. It would be nice to have this feature which will make the identification of ALB destinations much easier. Any ETA on when this can be made available? Atleast support to tag the target groups with custom labels?

@xeivieni
Copy link

xeivieni commented Aug 4, 2022

I also agree that naming the target groups could be a useful feature, for example when monitoring the traffic handled by the target we may want to be able to clearly bind it to the service name, not guessing it from the X first letter.

@dev-hanz-ops
Copy link

same here, we have both 80 and 443 listening and would like to see at first glance what targetgroup handles what traffic.
as often times, the same service exposes multiple ports, we actually would not only need a custom prefix, but on top an option to include the service-port in the targetgroup's name

so there could be 2 annotations:
alb.ingress.kubernetes.io/targetgroup-name-prefix
and alb.ingress.kubernetes.io/include-serviceport-in-targetgroup-name

this would translate to

  • only prefix-annotation set: {custom_prefix}-{hash} (as outlined in earlier comments on this issue)
  • only serviceport-annotation set: k8s-{tags}-{port}-{hash} (the default as it is now, just enhanced by the serviceport)
  • both annotations set: {custom_prefix}-{port}-{hash}

is something in this direction possible?

@higauravkohli
Copy link

+1

7 similar comments
@a-tharva
Copy link

a-tharva commented Oct 3, 2022

+1

@paraspachpute
Copy link

+1

@lucasfnds
Copy link

+1

@ghost
Copy link

ghost commented Nov 17, 2022

+1

@gwynnebaer
Copy link

+1

@andrey-iliyov
Copy link

+1

@oleg-ku-32768
Copy link

+1

@GeorgeTsilias
Copy link

This would help in cases were a single ALB has multiple target groups behind it.
Currently if you create an ingress object named "microservice-abc" on a namespace also named "microservice-abc" the generated target group is k8s-microser-microser-{10_random_chars} which is not quite helpful.
Of course there's the ingress.k8s.aws/resource tag which clears things up but filtering by tag is not always possible, e.g creating a Keda ScaledObject based on the TargetGroup CW Dimension.

@minhhoangvn
Copy link

+1

1 similar comment
@oleg-ku-32768
Copy link

+1

@fernando1989mg
Copy link

+1 pleaseeeee

@szheliab
Copy link

szheliab commented Jul 6, 2023

+1

@akumar-99
Copy link

+1
I use promethus-cloudwatch-exporter and I want to setup grafana dashboards. Having custom target group names will be of great help.

@neilkuan
Copy link
Contributor

neilkuan commented Aug 9, 2023

+1

1 similar comment
@HarshRohila
Copy link

+1

@rnasby
Copy link

rnasby commented Sep 4, 2023

+1

@frankh
Copy link

frankh commented Sep 28, 2023

had a crack at it if anyone wants to take a look at my PR ^

@asychev
Copy link

asychev commented Dec 27, 2023

+1

2 similar comments
@bryan-rhm
Copy link

bryan-rhm commented Jan 4, 2024

+1

@AndrewCharlesHay
Copy link

+1

@AndrewCharlesHay
Copy link

AndrewCharlesHay commented Jan 8, 2024

I made a contribution to @frankh's PR 😀

@gunzy83 why the thumbs down?

@gunzy83
Copy link

gunzy83 commented Jan 9, 2024

I made a contribution to @frankh's PR 😀

@gunzy83 why the thumbs down?

Every time someone +1's, those of us subscribed for updates get a pointless notification. I guess I just added another one by responding.

@thiborgesnvs
Copy link

thiborgesnvs commented Apr 4, 2024

There is a lot of people that need this feature to do better jobs and automations

Can I do something here to help and have this feature included ?

On my work we use a name pattern to identify all the assets and configurations and don't have for targets on LB cause some errors when other teams try understand our targets

Here is an example

LB Name --->

image

TG Names --->

image

@AndrewCharlesHay
Copy link

There is a lot of people that need this feature to do better jobs and automations

Can I do something here to help and have this feature included ?

@thiborgesnvs I'm not a maintainer but we've been working on this PR. @frankh seems to have stopped responding and I haven't had the opportunity to look into @M00nF1sh 's requested changes. You can try your hand at it if you want

@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

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

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

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 3, 2024
@kkashyap1707
Copy link

Any update on this annotation for target group ???

@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

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

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

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 14, 2024
@bryan-rhm
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 14, 2024
@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

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

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

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 12, 2024
@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

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

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

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 12, 2024
@DanielRailean
Copy link

any updates on this ?

@vc019
Copy link

vc019 commented Jan 16, 2025

This would be a handy feature, especially when using the target group created by the controller in other apps or controllers.

@vc019
Copy link

vc019 commented Jan 16, 2025

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 16, 2025
@lauren-hinge
Copy link

+1'ing with some detail, as I'm not sure the PR that was opened to address this issue (which seems abandoned) actually resolves it.

If I want a single ALB pointing at more than one target group, and I want to differentiate the CloudWatch metrics by path -- the only dimension CloudWatch gives us is the target group name.

With that in mind, we only have the first 8 characters of the K8s Service name to work with, to differentiate those metrics.

So I personally am not looking to "globally" change the prefix for all target groups for a given ALB -- I'm looking for each target group's name to be configurable.

However, my use case (target group names by url path) is not generalizable, and I struggle to see how a solution within a single ALB's annotations could be.

So instead I'm wondering -- could we take advantage of group.name here? Ingress groups solve a similar pattern, where we're intentionally splitting an ALB's config into distinct Ingress resources we want to manage separately.

If every ingress in a given group can declare its own target-group-prefix (the annotation from that PR), and when merging the ingresses it can pass that context to the target group creation process (rather than having the annotations clobber each other), then I think many use cases would be solved.

Just a thought! But for now, I'm just going to hope all the helm charts I'm using let me set a prefix for service name, so I can jam context into the first 8 characters 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests