Resolve DNS
This feature is available in the vCluster Pro tier. Contact us for more details and to start a trial.
This feature enables adding custom DNS rules to the virtual cluster to allow communication with services deployed in the host cluster and across services in separate vCluster instances.
Examplesβ
Map a hostnameβ
This is a URL-based mapping of one virtual cluster hostname to another hostname. A wikipedia.com
DNS lookup would return a DNS response with answer as en.wikipedia.org
.
networking:
resolveDNS:
- hostname: wikipedia.com
target:
hostname: en.wikipedia.org
Map a virtual cluster service to a host cluster serviceβ
This example maps the virtual cluster's my-namespace/my-svc
resource to the host cluster's dns-test/nginx-svc
resource. The DNS response is the nginx-svc
IP in the host's dns-test
namespace.
networking:
resolveDNS:
- service: my-namespace/my-svc
target:
hostService: dns-test/nginx-svc
Map services across vCluster instancesβ
This example maps a virtual cluster Service to another Service in a separate virtual cluster.
my-ns-in-vcluster/my-svc-vcluster
maps to dns-test-in-vcluster-ns/test-in-vcluster-service
in a vCluster instance named test-cluster
deployed in the host namespace test-vcluster-ns
.
networking:
resolveDNS:
- service: my-ns-in-vcluster/my-svc-vcluster
target:
vClusterService: test-vcluster-ns/test-vcluster/dns-test-in-vcluster-ns/test-in-vcluster-service
Map namespacesβ
Map all services under a virtual cluster namespace to a host namespace. This host namespace could also contain another vCluster instance, thereby mapping all vCluster services to another vCluster instance.
networking:
resolveDNS:
- namespace: test-in-vcluster-ns
target:
hostNamespace: external-vc-ns
All services in the test-vcluster
virtual cluster's target namespace test-in-vcluster-ns
map to namespace external-vc-ns
.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βnginx.external-vc-ns ββnginx.test-in-vcluster-ns β
βsvcA.external-vc-ns ββsvcA.test-in-vcluster-ns β
βsvcB.external-vc-ns ββsvcB.test-in-vcluster-ns β
β... ββ... β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Config referenceβ
resolveDNS
required object[] proβ
ResolveDNS allows to define extra DNS rules. This only works if embedded coredns is configured.
resolveDNS
required object[] proβhostname
required string proβ
Hostname is the hostname within the vCluster that should be resolved from.
hostname
required string proβservice
required string proβ
Service is the virtual cluster service that should be resolved from.
service
required string proβnamespace
required string proβ
Namespace is the virtual cluster namespace that should be resolved from.
namespace
required string proβtarget
required object proβ
Target is the DNS target that should get mapped to
target
required object proβhostname
required string proβ
Hostname to use as a DNS target
hostname
required string proβip
required string proβ
IP to use as a DNS target
ip
required string proβhostService
required string proβ
HostService to target, format is hostNamespace/hostService
hostService
required string proβhostNamespace
required string proβ
HostNamespace to target
hostNamespace
required string proβvClusterService
required string proβ
VClusterService format is hostNamespace/vClusterName/vClusterNamespace/vClusterService
vClusterService
required string proβ