Skip to main content
Version: main 🚧

Resolve DNS


Pro Feature

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 hostname wildcard​

This is a URL-based mapping of one virtual cluster hostname to another hostname. A test.svc.kubernetes DNS lookup would return a DNS response with answer as test.svc.cluster.local.

networking:
resolveDNS:
- hostname: *.svc.kubernetes
target:
hostname: *.svc.cluster.local

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.

hostname required string pro​

Hostname is the hostname within the vCluster that should be resolved from.

service required string pro​

Service is the virtual cluster service that should be resolved from.

namespace required string pro​

Namespace is the virtual cluster namespace that should be resolved from.

target required object pro​

Target is the DNS target that should get mapped to

hostname required string pro​

Hostname to use as a DNS target

ip required string pro​

IP to use as a DNS target

hostService required string pro​

HostService to target, format is hostNamespace/hostService

hostNamespace required string pro​

HostNamespace to target

vClusterService required string pro​

VClusterService format is hostNamespace/vClusterName/vClusterNamespace/vClusterService