I have three issues:
1 - How can I correctly implement regex to match the first part of a path in ingress?
- path: /^search_[0-9A-Z]{9}
backend:
serviceName: global-search-service
servicePort: 5050
I would like to match any path that begins with /search_
e.g /search_model
or /search_make
2 - How can I access a service with no path just port.
path:
pathType: Exact
backend:
serviceName: chart-display
servicePort: 10000
I am just displaying this service using iframe. How do I access it since I only have the port number?
3 - I am hosting two different react apps, both of them work when I set their path as root /
.. how do I implement both of them to work with root path?
Trying issue 3.
So I come up with something like this right?
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: admin-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /admin
backend:
serviceName: web2-service
servicePort: 2000
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: normal-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: web1-service
servicePort: 1000
Loading <my-ip>/admin
does not go to web2-service, and if i leave them both at /
, it automatically goes to web1-service. Kindly advice