I have the following ingress config:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /
pathType: Exact
backend:
serviceName: web-service
servicePort: 5000
paths:
- path: /api/tasks/.*
pathType: Prefix
backend:
serviceName: tasks-service
servicePort: 5004
paths:
- path: /api/.*
pathType: Prefix
backend:
serviceName: um-service
servicePort: 5001
I'm intending to load the frontend by default then, use the other paths for loading other services. I would like to get the total tasks count from /api/tasks/total_count
and raise new task from /api/tasks/raise
. At the same time, I would like to login using /api/auth/login/
and view other users with /api/users/list
both served with the um-service.
The above configuration only returns the default path of the last service which is the um-service.
How do I configure so that web loads by default, then either /api/auth/login
or /api/users/list
are routed to the um-service and /api/tasks/
is also routed to the tasks service? Kindly advice