The email-to-discuss interface is poor, and it looks like some of my responses got corrupted.
Can you show both YAMLs you loaded? Are they the same host or different hosts? What I can’t tell is if your ingress controller is broken or whether it is doing what you said, which is not the same as doing what you meant.
It looks like you are using the nginx controller? That’s pretty well debugged at this point, so it doesn’t seem likely that such a fundamental bug is still hiding. You may want to check its logs, too.
For example: if you do this, it should give you 2 hosts:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: foo
spec:
rules:
- host: foo.example.com
http:
paths:
- backend:
serviceName: foo-service
servicePort: 8080
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: bar
spec:
rules:
- host: bar.example.com
http:
paths:
- backend:
serviceName: bar-service
servicePort: 8080
But if you do this, it should give you a single host with 2 paths:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: foo
spec:
rules:
- host: example.com
http:
paths:
- path: /foo
backend:
serviceName: foo-service
servicePort: 8080
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: bar
spec:
rules:
- host: example.com
http:
paths:
- path: /bar
backend:
serviceName: bar-service
servicePort: 8080