Aws-load-balancer-controller: Support specifying specific ports for specific services

Created on 11 Jul 2017  路  12Comments  路  Source: kubernetes-sigs/aws-load-balancer-controller

Using NodePorts
Example:
Annotation: alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80, "HTTPS": 443}, {"HTTP": 3000, "HTTPS": 3443}]'
/Service-1 (NodePort/Target Group 30035):
- Http Port 80
- Https Port 443
/Service-2 (NodePort/Target Group 30036):
- Http Port 3000
- Https Port 3443

Result:
ALB is created, but only points to a single target group.
ALB/Service-1 -> 30035
ALB/Service-2 -> 30035 (This should go to 30036)

areprovideaws kinfeature lifecyclrotten

Most helpful comment

Yes it seems we have 2 issues here.

1. Feature request: Support independent listener configs per service

Like @bigkraig, I agree this makes sense. I am however concerned that adding more flexibility like this will cause our configuration (through annotations) to become hard to manage. For example, with the listener-config-per-service support, how would we go about correlating ACM certs?

Not saying we shouldn't do this, just have to figure out a long term plan on how to keep configuration manageable.

2. Bug: Multiple services aren't respected as listeners always point to 1 target group

Per your result mentioned above, this shouldn't happen. It's also not something I've seen happen with all my multi-service ingress resources. I wonder if your listen-ports annotation, which isn't implemented as you're using it (see 1 above) is causing weirdness. After taking that out, let us know if this problem persists.

Please let me know if the above is aligned with your thinking.

All 12 comments

The assumption here is that the first set of ports in listen-ports would be matched to the first service in your list, and the second set the second service? AFAIK we haven't considered this situation but it makes sense to me.

Yes it seems we have 2 issues here.

1. Feature request: Support independent listener configs per service

Like @bigkraig, I agree this makes sense. I am however concerned that adding more flexibility like this will cause our configuration (through annotations) to become hard to manage. For example, with the listener-config-per-service support, how would we go about correlating ACM certs?

Not saying we shouldn't do this, just have to figure out a long term plan on how to keep configuration manageable.

2. Bug: Multiple services aren't respected as listeners always point to 1 target group

Per your result mentioned above, this shouldn't happen. It's also not something I've seen happen with all my multi-service ingress resources. I wonder if your listen-ports annotation, which isn't implemented as you're using it (see 1 above) is causing weirdness. After taking that out, let us know if this problem persists.

Please let me know if the above is aligned with your thinking.

I have a similar situation where I am trying to have two services routed to by different port using HTTPS.
I assume this an edge case, but would be good to utilise all the functionality of the AWS ALB.

Might I propose that you keep the alb.ingress.kubernetes.io/listen-ports annotation as is. Then create a separate annotation alb.ingress.kubernetes.io/service-listen-ports?

Syntax could be something like alb.ingress.kubernetes.io/service-listen-ports: [serviceA: [{"HTTP": 80, "HTTPS": 443}], serviceB: [{"HTTP": 90, "HTTPS": 444}]]

You can only specify listen-ports or service-listen-ports. Never both.

@joshrosso - Are there any plans to implement this or would it be worth discussing more?

I believe the bug part of this issue is resolved but i'm going to keep the service-listen-ports bit of this open as a feature req.

Is this supported? We have a similar use case.

Annotation: alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 3033}, {"HTTP": 3001, "HTTPS": 3002}]'

or service-listen-ports

/Service-1 (NodePort/Target Group 123):

  • Http Port 3033
    /Service-2 (NodePort/Target Group 234):
  • Http Port 3001
  • Https Port 3002

From the above discussion, seems still open.

Hello !
I have this problem too (we have 2 listener ports on the same ingress and we have different services. All services are added to both listeners) ... I'm thinking about this and, imho, the best solution is create the alb.ingress.kubernetes.io/listen-ports annotation in the service too.

Then, if we have a service without the annotation, we add this services to all listeners in the first group of ports in the listen-ports annotation. If the service have annotation, then we add this service only to the listeners that match the port/protocol defined in the annotation.

So, for example, ingress with this annotation
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80, "HTTPS": 443}, {"HTTP": 8080}]'
Services:
nginx -> without annotation
proxy -> with annotation: alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 8080}]'

The nginx service will be added to the 80 and 443 listeners. The proxy service will be added only to the listener with the 8080 port.

It's ok for you ? Comments ?

j

/sig aws

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

Was this page helpful?
0 / 5 - 0 ratings