Im using istio
latest version 1.17
and my application is having few routes
for example
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name:virtualservice
spec:
hosts:
- "*"
gateways:
- ingressgateway
http:
- match:
- uri:
prefix: "/"
- uri:
exact: "/api/users"
route:
- destination:
host: stb-mvs-us
now when use ingress gateway
kubectl get svc -n istio-system -l istio=ingressgateway
I see the external ip and if I use it like:
http://6026651-81434690.eu-central-1.elb.fds.com
I see the index page and it works
but my application is exposing also routes like
"/api/users”
When I access it via browser I got error 503, what could be the reason?
http://6026651-81434690.eu-central-1.elb.fds.com/api/users
If I switch service (for testing) to using LoadBalancer I can see that the route "/api/users” is working… Does my virtual service
config is wrong?
update
as suggested I've changed it to the following
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name:virtualservice
spec:
hosts:
- "*"
gateways:
- ingressgateway
http:
- match:
- uri:
exact: "/api/users"
route:
- destination:
host: stb-mvs-us
and I was able to see the root (index.html) and not able to see the path api/users
e.g. http://6026651-81434690.eu-central-1.elb.fds.com/api/users
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: http-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"