Hey folks.
The docs for virtual services here state:
Virtual service hosts don’t actually have to be part of the Istio service registry, they are simply virtual destinations. This lets you model traffic for virtual hosts that don’t have routable entries inside the mesh.
I’ve taken this to mean that I can create a virtual service, say router.default.svc.cluster.local
, with matching rules to route to services in my mesh without having to back it with anything. Then, in all of my service containers/application code, I can use dial router.default.svc.cluster.local
and have my traffic routed appropriately to the correct service.
Either I’m misunderstanding something or I’m struggling to get this working. My virtual service resembles:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: router
namespace: default
spec:
hosts:
- router.default.svc.cluster.local
gateways:
- gateway
http:
- match:
- uri:
prefix: "/proto.Foo/"
port: 51774
redirect:
authority: service-foo.default.svc.cluster.local:51774
- match:
- uri:
prefix: "/proto.Bar/"
port: 51774
redirect:
authority: service-bar.default.svc.cluster.local:51774
If I then try to examine the routing rules for service-foo
and service-bar
with istioctl proxy-config routes XXX --name=51773 -o json
, I see:
"routes": [
{
"name": "default",
"match": {
"prefix": "/"
},
"route": {
"cluster": "outbound|51774||service-foo.default.svc.cluster.local",
"timeout": "0s",
"retryPolicy": {
"retryOn": "connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes",
"numRetries": 2,
"retryHostPredicate": [
{
"name": "envoy.retry_host_predicates.previous_hosts"
}
],
"hostSelectionRetryMaxAttempts": "5",
"retriableStatusCodes": [
503
]
},
"maxStreamDuration": {
"maxStreamDuration": "0s",
"grpcTimeoutHeaderMax": "0s"
}
},
"decorator": {
"operation": "service-foo.default.svc.cluster.local:51774/*"
}
}
],
… which doesn’t include my routing rules.
Any tips for where to look debugging-wise would be very much appreciated.
Cheers!