Rajesh Nayak:
I have one URL, for example https://xyz.com, I have two services called frontend-abc and frontend-xyz. when I gave as https://xyz.com/one i need to route to frontend-abc and when i gave https://xyz.com/two the need to route to frontend-xyz in a browser using an ingress controller. Is it possible to do in ingress without any code changes?. am using gke 1.18.15-gke.1102 version.
new_day:
I think you can just routing this by ingress resource
new_day:
apiVersion: <http://networking.k8s.io/v1beta1|networking.k8s.io/v1beta1>
kind: Ingress
metadata:
name: test-ingress
annotations:
<http://nginx.ingress.kubernetes.io/use-regex|nginx.ingress.kubernetes.io/use-regex>: "true"
spec:
rules:
- host: <http://test.com|test.com>
http:
paths:
- path: /one
backend:
serviceName: test
servicePort: 80
- path: /two
backend:
serviceName: test2
servicePort: 80
Rajesh Nayak:
Thanks for reply, but didnt work in my case.
Mohamed Ayman:
Why It’s not working?
Mohamed Ayman:
Are you sure that the services frontend-abc and frontend-xyz working fine?
Rajesh Nayak:
yes, when i use port ward, both of them are working fine .