Closed chary1112004 closed 6 months ago
Hi @chary1112004 ,
From my understanding, if you want to configure rule priority, a way is to create two Ingresses with the same alb.ingress.kubernetes.io/group.name
[1] annotaion, and configure the Ingress order with alb.ingress.kubernetes.io/group.order
[2] annotation.
For example, you can set the Ingress with rule path /metrics
with smaller number of group.order
, so it's rule will be evaluated first.
[1] AWS Load Balancer Controller - Ingress annotations - alb.ingress.kubernetes.io/group.name https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.6/guide/ingress/annotations/#group.name
[2] AWS Load Balancer Controller - Ingress annotations - alb.ingress.kubernetes.io/group.order https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.6/guide/ingress/annotations/#group.order
Hi @ysam12345,
Thank you for your suggestion. As I know if we create new group then it means new application load balancer will be created. Does it cost for this new application load balancer (for example without throughput)?
Regards
Hi @chary1112004 ,
What I mean is to use multiple Ingresses with the same alb.ingress.kubernetes.io/group.name
. In this case, controller will only create a single ALB for multiple Ingresses, the rules in multiple Ingresses will be aggregate into a single ALB, just like the document said here [1]:
IngressGroup feature enables you to group multiple Ingress resources together.
The controller will automatically merge Ingress rules for all Ingresses within IngressGroup and support them with a single ALB.
In addition, most annotations defined on an Ingress only apply to the paths defined by that Ingress.
So it shouldn't create a new ALB without throughput. I hope this helps.
[1] IngressGroup https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.6/guide/ingress/annotations/#ingressgroup
Hi @ysam12345, thank you. I thought the group order is for ordering between groups, not same group.
I will give a try. Thank you!
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The priority on the rules is decided on the PathType. The prefix type take higher priority here than the implementations specific. https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.7/guide/ingress/spec/#ingress-specification Have you tried setting appropriate pathtype on your rules?
@shraddhabang thanks for the follow up. Since we have tried do manual step to re-order to work around currently then we did not have a chance to come back this again. I will close this one since there is already suggestion from @ysam12345
Hi @ysam12345,
We are coming back this one.
I have checked again then what you mean it could be for different hosts. For our case, we configure for same host (in this one is host: example.com) with different path.
@shraddhabang: yes, however we try to switch between prefix and implementations specific then there is error in ingress: prefix path shouldn't contain wildcards
Hi @chary1112004 ,
My reply is not specifically for the usecase of different hosts, you can define the same host with different path in different ingresses, because those Ingress Rules will be eventually transfered to ALB Listener rules.
group.order 10 -> 20 -> 30
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-1 annotations: alb.ingress.kubernetes.io/group.order: '10' alb.ingress.kubernetes.io/group.name: my-ingress-group spec: ingressClassName: alb rules: - host: foo.bar http: paths: - path: /* pathType: ImplementationSpecific backend: service: name: "foo-bar" port: number: 80 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-2 annotations: alb.ingress.kubernetes.io/group.order: '20' alb.ingress.kubernetes.io/group.name: my-ingress-group spec: ingressClassName: alb rules: - host: foo.bar http: paths: - path: /aaa pathType: ImplementationSpecific backend: service: name: "foo-bar" port: number: 80 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-3 annotations: alb.ingress.kubernetes.io/group.order: '30' alb.ingress.kubernetes.io/group.name: my-ingress-group spec: ingressClassName: alb rules: - host: foo.bar http: paths: - path: /bbb pathType: ImplementationSpecific backend: service: name: "foo-bar" port: number: 80
group.order 30 -> 20 -> 10
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-1 annotations: alb.ingress.kubernetes.io/group.order: '30' alb.ingress.kubernetes.io/group.name: my-ingress-group spec: ingressClassName: alb rules: - host: foo.bar http: paths: - path: /* pathType: ImplementationSpecific backend: service: name: "foo-bar" port: number: 80 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-2 annotations: alb.ingress.kubernetes.io/group.order: '20' alb.ingress.kubernetes.io/group.name: my-ingress-group spec: ingressClassName: alb rules: - host: foo.bar http: paths: - path: /aaa pathType: ImplementationSpecific backend: service: name: "foo-bar" port: number: 80 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-3 annotations: alb.ingress.kubernetes.io/group.order: '10' alb.ingress.kubernetes.io/group.name: my-ingress-group spec: ingressClassName: alb rules: - host: foo.bar http: paths: - path: /bbb pathType: ImplementationSpecific backend: service: name: "foo-bar" port: number: 80
I'm not sure if this meets your requirement, also please ignore the HTTP 503 response code in the screenshot becuase I didn't define "foo-bar" in my environment.
Hi @ysam12345,
I have added multiple ingress with same host and different group order (in same group) then it works for me.
Thanks for your support!
This is also worked for host definitions. Thanks a lot.
Describe the bug We are facing issue with priority order rule
ingress manifest
Expected outcome
Any solution to resolve this issue would be very much appreciated!
Environment