Update DNS server references in Tanzu Kubernetes Grid (TKGm) clusters without NSX
search cancel

Update DNS server references in Tanzu Kubernetes Grid (TKGm) clusters without NSX

book

Article ID: 422047

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Management

Issue/Introduction

Administrators may need to change the DNS server referenced across all nodes and Pods in a TKGm cluster. Since DNS settings are typically distributed from an external DHCP server, additional steps are required to ensure that TKG nodes and Kubernetes components (CoreDNS, NodeLocalDNS) use the new DNS.

Environment

TKGm v2.5.x and similar environments where DNS is provided via external DHCP

Networking: No NSX  

 

Cause

TKGm does not provide a supported mechanism to regenerate or re-create nodes directly from updated DHCP configuration (dhcpd.conf). Therefore, DNS changes must be propagated manually to the cluster nodes and DNS services.

Resolution

Recommended procedure to update DNS in TKGm clusters:

  1. Deploy the new DNS server.

  2. Update the DHCP server configuration (dhcpd.conf) with the new nameserver.

Refresh each TKG node’s resolv.conf:

ssh capv@<node-ip>
sudo dhclient -r      # release DHCP lease
sudo dhclient         # request new lease
cat /etc/resolv.conf  # verify updated nameserver
 
   3. (Optional) Restart CoreDNS in both management and workload clusters.

  4. (Optional) Restart NodeLocalDNS in workload clusters.

Note: Steps 4 and 5 are usually not required, as Pods will use the updated node resolv.conf. However, in rare cache-related cases, restarting CoreDNS/NodeLocalDNS may help and is safe to perform.

Best Practice: Test the procedure in a lab or development environment before applying in production.

Additional Information