Open
Description
Currently there is no way to specify a Target
selector in the case when a Target
is created inline inside a VirtualService
.
In particular, the below example to route DNS requests to a my-dns
service should work:
kind: VirtualService
metadata:
name: dns-gateway
namespace: default
spec:
selector:
matchService: l7mp-ingress
listener:
spec:
UDP:
port: 5053
rules:
- action:
route:
destination:
cluster:
spec:
UDP:
port: 53
selector:
matchService: my-dns
Unfortunately, this is now rejected since the OpenAPI schema requires the route.destination
property to contain a Cluster
but this does not allow a the target service selector to be defined:
...
properties:
....
destination:
$ref: '#/components/schemas/Cluster'
Instead, the route.destination
should point to a Target
, which specifies its own target selector:
...
properties:
....
destination:
$ref: '#/components/schemas/Target'
A workaround exists: simply specify a separate Target
, say, my-dns-target
and then let the VirtualService
route refer to this Target
but this superfluously complicates the mesh config:
kind: VirtualService
metadata:
name: dns-gateway
namespace: default
spec:
selector:
matchService: l7mp-ingress
listener:
spec:
UDP:
port: 5053
rules:
- action:
route:
destinationRef: my-dns-target
Please, fix.