High DNS query rates in ACK Serverless clusters can cause latency spikes when pods must reach out to remote DNS servers. BlazingDNS intercepts DNS queries from pods running on Elastic Container Instances (ECI) and serves responses from a kernel-level local cache, eliminating the round-trip cost—without modifying your pod's dnsConfig or DNS server settings.
Prerequisites
Before you begin, make sure you have:
An ACK Serverless cluster. For more information, see Create an ACK Serverless cluster.
The ACK virtual node component installed and upgraded to version 2.10.0-rc.10 or later. For more information, see Manage system components.
How BlazingDNS works
BlazingDNS is a kernel-level DNS caching program. When a pod on an ECI sends a DNS query, BlazingDNS intercepts the query and checks its local cache before forwarding to the upstream DNS server. Cached responses are served immediately, reducing latency.
Because caching runs at the kernel level, no changes to dnsConfig or DNS server settings are required.
After BlazingDNS is installed, DNS requests from elastic container instances are cached automatically, as shown in the following figure:
Limitations
BlazingDNS is only available in ACK Serverless clusters and only accelerates DNS resolution for pods running on ECIs. The following additional limitations apply:
Supports DNS queries for A, AAAA, and CNAME records only.
Supports UDP-based DNS queries only.
Supports DNS query responses of 256 bytes or smaller only.
DNS cache acceleration applies only to pods created after BlazingDNS is installed. Existing pods are not affected.
Install BlazingDNS
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, click the name of the cluster you want to manage. In the left-side navigation pane, choose Operations > Add-ons.
On the Add-ons page, click the Networking tab. Find the BlazingDNS card, then click Install and follow the on-screen instructions.
After installation:
A ConfigMap named
blazing-dnsis created in thekube-systemnamespace. Do not modify or delete this ConfigMap.DNS cache acceleration is automatically enabled for new pods created on ECIs.
Verify that BlazingDNS is active
To confirm that DNS cache acceleration is enabled for a pod, check the k8s.aliyun.com/dns-cache-enable annotation. A value of true means the pod has DNS cache acceleration enabled.
Upgrade BlazingDNS
On the Add-ons page, click the Networking tab. Find the BlazingDNS card, then click Upgrade and follow the on-screen instructions.
Uninstall BlazingDNS
Before uninstalling BlazingDNS, disable it for all running pods.
Step 1: Identify pods with BlazingDNS enabled
Run one of the following commands to list pods that have BlazingDNS enabled:
kubectl get pod -o=jsonpath='{.items[?(@.metadata.annotations.k8s\.aliyun\.com/dns-cache-enable=="true")].metadata.name}' -AIf jq is installed on the current node, run the following command to also print the namespace for each pod:
kubectl get pod -o=jsonpath='{.items[?(@.metadata.annotations.k8s\.aliyun\.com/dns-cache-enable=="true")]}' | jq -rc ".metadata.namespace,.metadata.name"Step 2: Disable BlazingDNS for affected pods
If the commands above return results, disable BlazingDNS before proceeding:
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, click the name of the cluster. In the left-side navigation pane, choose Configurations > ConfigMaps.
On the ConfigMap page, select the
kube-systemnamespace. In the Actions column of theblazing-dnsConfigMap, click Edit. In the panel that appears, setconfigtoenabled: false.Delete and recreate the affected pods, then rerun the command from Step 1 until no pods are returned.
Step 3: Uninstall the component
On the Add-ons page, click the Networking tab. Find the BlazingDNS card, then click Uninstall and follow the on-screen instructions.