Reputation: 1557
Is it possible to create multiple ingress objects with similar rules referencing the same backend service on the same port?
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress1
spec:
rules:
- host: green.com
http:
paths:
- path: /
backend:
serviceName: red-svc
servicePort: 80
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress2
spec:
rules:
- host: pink.com
http:
paths:
- path: /
backend:
serviceName: red-svc
servicePort: 80
Upvotes: 4
Views: 5937
Reputation: 44549
It depends on the implementation of the ingress controller you are using. For nginx below rules apply while building the nginx model
Since you have different host none of the above apply and it should fine i.e both
green.com
and pink.com
should route traffic to the same backend red-svc
on port 80
Upvotes: 3