You are browsing documentation for an outdated version.
See the latest documentation here.
This policy lets you customize hostnames and ports for communicating with data plane proxies.
Possible use cases are:
1) Preserving hostnames when migrating to service mesh.
2) Providing multiple hostnames for reaching the same service, for example when renaming or for usability.
3) Providing specific routes, for example to reach a specific pod in a service with StatefulSets on Kubernetes, or to add a URL to reach a specific version of a service.
4) Expose multiple inbounds on different ports.
A virtual outbound that contains any parameters other than
kuma.io/service won’t work cross-zone.
(hostname, port) combinations are detected, the virtual outbound with the highest priority takes over. For more information, see the documentation on how Kong Mesh chooses the right policy. All duplicate instances are logged.
conf.port are processed as go text templates with a key-value pair derived from
conf.selectors are used to specify which proxies this policy applies to.
For example a proxy with this definition:
- port: 9000
and a virtual outbound with this definition:
- name: service
- name: port
- name: v
produce the hostname:
v1.backend.mesh with port:
- Either data plane proxy DNS, or else the value of
conf.host must end with the value of
dns_server.domain (default value
name must be alphanumeric. (Used as a go template key).
- Each value of
name must be unique.
kuma.io/service must be specified even if it’s unused in the template. (Prevents defining hostnames that spans services).
The default value of
tagKey is the value of
For each virtual outbound, the Kong Mesh control plane processes all data plane proxies that match the selector.
It then applies the templates for
conf.port and assigns a virtual IP address for each hostname.
The following examples show how to use virtual outbounds for different use cases.
Same as the default DNS
One hostname per version
Custom tag to define the hostname and port
One hostname per instance
Enables reaching specific data plane proxies for a service.
Useful for running distributed databases such as Kafka or Zookeeper.