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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With