Is there an order to Ingress rule specification i.e. will the first qualifying rule be honored?
The intention of following spec is to route all requests that do not have headers Host: foo.com
and Host: bar.com
and route them to service3. I am not sure if the spec is syntactically correct and more so, if it will serve the desired purpose?
spec:
rules:
- host: foo.com
http:
paths:
- backend:
serviceName: service1
servicePort: http
path: /
- host: bar.com
http:
paths:
- backend:
serviceName: service2
servicePort: http
path: /a/b/c
- http:
paths:
- path: /a/b/c
backend:
serviceName: service3
servicePort: http
Don't think it matters, but I am using the Contour Ingress controller.
I am not familar with Contour, I just quickly browse the doc.
How Contour works with
Ingress
rule is not clear from its document. I think Contour perfer using its CRDIngressRoute
to specify how request rule works.So I infer your
Ingress
behavior from offical kubernetes ingress rule:host: foo.com
will route toservice1
orservice3
host: bar.com
will route toservice2
orservice3
service3