I have two services running on minikube, Foo
and Bar
. When I'm accessing the Foo
service it makes a request to Bar
service to retrieve some data. Bar
service have 2 versions "1.0"
and "2.0"
.
I have setup the default RouteRule
configuration with istio
to route all the requests to "1.0"
:
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
name: bar-default
spec:
destination:
name: bar-server
precedence: 1
route:
- labels:
version: "1.0"
It works fine, and I can see that all the requests is forwarded to "1.0"
.
Now I want to add another RouteRule
based on the headers, so all the requests from Chrome
browser will be forwarded to "2.0"
:
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
name: bar-v2
spec:
destination:
name: bar-server
precedence: 2
match:
request:
headers:
user-agent:
regex: ".*Chrome.*"
route:
- labels:
version: "2.0"
And it doesn't work. All the requests are still routed to "1.0"
.
I can see that the RouteRule
is created:
> istioctl get routerules
NAME KIND NAMESPACE
bar-default RouteRule.v1alpha2.config.istio.io default
bar-v2 RouteRule.v1alpha2.config.istio.io default
I can see in the developers tools in browser that the UserAgent
header is present.
How can I debug the request to see why doesn't it get forwarded to "2.0"
?