3

Kubernetes cluster is running on a node (Virtual Machine) which gets its network configuration from a DHCP server (this includes DNS settings).

From within a pod I need to be able to reach external resources identified by FQDN. The DNS on the K8 node (VM) is able to solve the FQDN to an IP address but how could I make it accessible to the pod? Also I need to support the scenario when the DNS settings change in the VM where K8 cluster is running.

The FQDN resources are not known upfront.

klaus johan
  • 4,370
  • 10
  • 39
  • 56
  • You need to allow all public ip addresses in firewall configurations if has configured for the node. If you have preconfigured some [network policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) check them as well – Amila Senadheera Feb 25 '23 at 13:28

1 Answers1

1

You can configure Kubernetes to use your host's DNS resolver by setting up dnsPolicy for the pod by selecting either Default or ClusterFirstWithHostNet.

  • The first option uses the cluster DNS if available, and falls back to the host's DNS resolver if none is found.
  • The second option uses the cluster DNS first, and fallsback to the host DNS resolver if it can't resolve the name.

https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/

linuxgx
  • 401
  • 2
  • 9