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

ALB ingress object to contain listener ARN

Open wildtapir opened this issue 2 years ago • 10 comments

Is your feature request related to a problem? I am trying to integrate AWS HTTP API gateway using apigatewayv2 ACK . One of the parameters I need to provide is integrationURI which is an ARN of ALB Listener.

Describe the solution you'd like ALB ingress object to contain listener ARN so I can query for it dynamically.

wildtapir avatar Jun 10 '22 13:06 wildtapir

The TargetGroupBinding has spec.targetGroupARN which will let you query the load balancer for listeners.

iamnoah avatar Jun 24 '22 15:06 iamnoah

@wildtapir, you could describe the load balancer based on the name which you can get from the ingress status field. Once you have the load balancer ARN, you get the listeners.

kishorj avatar Jun 24 '22 18:06 kishorj

Thanks @kishorj ! Gould you please give me an example? I start with kubectl get ingress demo-service -o yaml

wildtapir avatar Jun 29 '22 13:06 wildtapir

Here is one way to do it

  • From the kubectl output, look for the status field, you will see the load balancer DNS name
  • Extract the load balancer name, for example if dns name is k8s-default-demoserv-xxx-yyy.REGION.elb.amazonaws.com, lb name is k8s-default-demoserv-xxx
  • describe load balancer, aws elbv2 describe-load-balancers --names k8s-default-demoserv-xxx, get the LoadBalancerArn
  • describe listeners, aws elbv2 describe-listeners --load-balancer-arn arn:aws:elasticloadbalancing...

kishorj avatar Jun 29 '22 15:06 kishorj

Thanks @kishorj for prompt response. I cannot use aws cli here as requirement is to be able to query for data k8s objects only. I am using helm and there is lookup function (which is kind of kubectl get).

wildtapir avatar Jun 30 '22 09:06 wildtapir

I was looking at TargetGroupBinding but I cannot find anything there that would map spec.targetGroupARN to AWS LoadBalancer. Only reference is serviceRef (which might have multiple load balancers)

wildtapir avatar Jul 08 '22 13:07 wildtapir

This controller applies labels to all k8s resources it creates, for example all TargetGroupBinding resources created by this controller have the following labels:

  • explicit IngressGroup
    • ingress.k8s.aws/stack: groupName
  • implicit IngressGroup:
    • ingress.k8s.aws/stack-namespace: namespace
    • ingress.k8s.aws/stack-name: ingressName
  • NLB (service of type LoadBalancer or with NLB annotations)
    • service.k8s.aws/stack-namespace: namespace
    • service.k8s.aws/stack-name: serviceName

You should be able to associate the TargetGroupBinding resources to your ingress stack based on the lablels.

kishorj avatar Jul 08 '22 17:07 kishorj

Thank you @kishorj . Let me be more clear. What I need is listener arn of an ALB. listener arn is not the same as targetGroupARN. Do you know of any object in k8s that would contain listener arn of an ALB?

wildtapir avatar Jul 11 '22 16:07 wildtapir

I have similar a problem. @wildtapir any luck so far?

eligithubacc avatar Jul 20 '22 13:07 eligithubacc

Hi @eligithubacc. Nope, I was not able to use kubectl only to get listener arn.

wildtapir avatar Jul 21 '22 08:07 wildtapir

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-triage-robot avatar Oct 19 '22 08:10 k8s-triage-robot

The Kubernetes project currently lacks enough active 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 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 rotten

k8s-triage-robot avatar Nov 18 '22 09:11 k8s-triage-robot

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

This bot triages 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:

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

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

/close not-planned

k8s-triage-robot avatar Dec 18 '22 09:12 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

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

This bot triages 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:

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

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

/close not-planned

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 avatar Dec 18 '22 09:12 k8s-ci-robot