aws-load-balancer-controller
aws-load-balancer-controller copied to clipboard
Combine multiple LB rules to one rule with OR
Is your feature request related to a problem? Let's say we have the following (I used use-annotation, but it doesn't matter)
- host: myFirstDNS.example.com
http:
paths:
- backend:
service:
name: canary
port:
name: use-annotation
path: /
pathType: Prefix
- host: mySecondDNS.example.com
http:
paths:
- backend:
service:
name: canary
port:
name: use-annotation
path: /
pathType: Prefix
This will create 2 Load Balancer rules on the load balancer, the first with condition:
Path Pattern is /*, AND
HTTP Host Header is myFirstDNS.example.com
and the second with condition:
Path Pattern is /*, AND
HTTP Host Header is mySecondDNS.example.com
However, it could have created only 1 rule with condition
Path Pattern is /*, AND
HTTP Host Header is myFirstDNS.example.com or mySecondDNS.example.com
Creating multiple rules increase the rules evaluation (and therefore creates additional costs), and it's also less clear. Describe the solution you'd like Combine ingress rules with the same settings but different prefix\host to one rule
Describe alternatives you've considered Creating multiple LBs to avoid the extra evaluations costs
It would be nice to see this implemented :+1: It would partially solve this one https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/1784 too.
Thanks for bringing this up, I think it's a good improvement to have. I think we can have the controller to merge the paths for each ingress if:
- they are routing to the same service, and
- they have the same host, and
- they are of the same pathType
For example, when creating an ingress with the following spec:
spec:
rules:
- http:
paths:
- path: /test1
pathType: ImplementationSpecific
backend:
service:
name: my_service
port:
number: 80
- path: /test2
pathType: ImplementationSpecific
backend:
service:
name: my_service
port:
number: 80
- http:
paths:
- path: /*
pathType: ImplementationSpecific
backend:
service:
name: my_service
port:
number: 80
The controller is generating three rules right now:
- rule 1: /test1 → my_service
- rule 2: /test 2 → my_service
- rule 3: /* → my_service
With the change the controller will only generate one rule:
- rule 1: /test1 OR /test2 OR /* → my_service
/kind feature
What is the maximum number of characters (or clauses) that can be merged into a single matcher line? If a rule would exceed it, it should be split into multiple rules at some boundary.
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
/remove-lifecycle stale
/assign
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
/remove-lifecycle stale