Reputation: 418
I've the following ingress configuration but when I call www.domain.com/api
it always open my UI service instead of API and the same thing happens if I call something else after api, for example www.domain.com/api/v1/projects
.
How can I fix that?
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
spec:
tls:
- secretName: tls
backend:
serviceName: ui
servicePort: 5003
rules:
- host: www.domain.com
http:
paths:
- path: /
backend:
serviceName: ui
servicePort: 5003
- path: /api
backend:
serviceName: api
servicePort: 5000
Upvotes: 2
Views: 866
Reputation: 418
Here is the way I fixed this problem. I hope this can help others.
Thanks @aleks!!
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kronus
spec:
tls:
- secretName: tls
backend:
serviceName: ui
servicePort: 5003
rules:
- host: domain.com
http:
paths:
- path: /api
backend:
serviceName: api
servicePort: 5000
- path: /api/*
backend:
serviceName: api
servicePort: 5000
- host: www.domain.com
http:
paths:
- path: /api
backend:
serviceName: api
servicePort: 5000
- path: /api/*
backend:
serviceName: api
servicePort: 5000
Upvotes: 2