Yonatan Huber
Yonatan Huber

Reputation: 308

bind9 VM as an external DNS for k8s pods

I have a system that is composed of three main components: a k8s cluster, a bind9 VM "internal DNS server" and a replicaSet of mongoDB (each mongo machine is a VM). Everything is in GCP.

The k8s cluster is in one network (lets call it net1) and the bind9 and mongoVMs are on a different network (net2).

I have successfully configured bind9 to serve as the DNS for all VMs in both networks, however when I try to send kube-dns to use the bind9's external IP as it's stubdomain for my somedomain.com domain, DNS resolution inside pods fail. [namely, pinging foo.somedomain.com produces an "unknown host" error].

I have done the following:

  1. added the cluster's external IP into the allow-query line of bind9.
  2. configured the proper firewall rules. communication over port 53 is free between cluster's pods and bind9's VM.
  3. my configMap has this: stubDomains {"somedomain.com": ["externalIP for bind9 VM"], "internal": [ "169.254.169.254" ] }

When I run this, DNS resolution fails. But if I switch to a bind9 VM that is inside net1, and uses its internal IP, this works.

This is not a communication/permission problem. traceroute via port 53 works.

Please advice?

Upvotes: 0

Views: 448

Answers (0)

Related Questions