Configure NodeLocal DNSCache
TOC
Overview
NodeLocal DNSCache is a cluster plugin that improves cluster DNS performance by running a DNS caching proxy on cluster nodes. This plugin reduces DNS query latency and improves cluster stability by caching DNS responses locally on each node, minimizing the load on the central DNS service.
Key Features
- Local DNS Caching: Caches DNS responses locally on each node to reduce query latency
- Improved Performance: Significantly reduces DNS lookup times for applications
Important Notes
Deployment Considerations:
-
Kube-OVN Underlay Mode: The plugin does not support deployment in Kube-OVN Underlay mode. If deployed, it may cause DNS query failures.
-
Kubelet Restart: Deploying this plugin will cause the kubelet to restart.
-
Pod Restart Required: After the plugin is successfully deployed, it will not affect running Pods, but will only take effect on newly created Pods. When the CNI is Kube-OVN, you need to manually add the parameter "--node-local-dns-ip=(IP address of the local DNS cache server)" to the kube-ovn-controller.
-
NetworkPolicy Configuration: If NetworkPolicy is configured in the cluster, you need to additionally allow both from and to directions for the node CIDR and nodeLocalDNSIP in the networkPolicy to ensure proper communication.
4.2.x Upgrade Notes
When upgrading this plugin from versions below 4.2.0 (excluding 4.2.0 itself) to 4.2.x, the following steps are required due to ResourcePatch compatibility issues:
Before Upgrade:
- Record the
--node-local-dns-ipparameter value from the kube-ovn-controller ResourcePatch configuration - Delete the ResourcePatch for the
deploy/kube-ovn-controllerresource
After Upgrade:
- Manually add the recorded
--node-local-dns-ipparameter back to the kube-ovn-controller configuration
Note: This compatibility issue has been resolved in version 4.3 and above, so manual intervention is not required for upgrades to 4.3+.
Installation
Install via Marketplace
-
Navigate to Administrator > Marketplace > Cluster Plugins.
-
Search for "Alauda Build of NodeLocal DNSCache" in the plugin list.
-
Click Install to open the installation configuration page.
-
Configure the required parameters:
-
Review the deployment notes and ensure your environment meets the requirements.
-
Click Install to complete the installation.
-
Wait for the plugin status to change to "Ready".
How It Works
Architecture
Configuration
Network Policy Configuration
Important: If your cluster has NetworkPolicy enabled, you must configure proper rules to allow DNS traffic to the NodeLocal DNSCache. Without these rules, pods may not be able to resolve DNS queries.
When using NetworkPolicy, ensure the following DNS traffic is allowed: