8000 l7mp-operator: Support inline Target definitions in VirtualService objects · Issue #85 · l7mp/l7mp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
8000
Skip to content
l7mp-operator: Support inline Target definitions in VirtualService objects #85
Open
@rg0now

Description

@rg0now

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0