[BUG] NPD DNS health check fails to discover CoreDNS IP on additional system/user node pools
Describe the bug
Node Problem Detector's DNS health check script fails to discover the correct CoreDNS service IP on additional system and user node pools, resulting in persistent CoreDNSUnreachable warning events. The script successfully discovers the IP on the default system node pool but falls back to an incorrect hardcoded default (10.0.0.10) on other pools.
Root cause: AKS provisions different node pool types with inconsistent kubelet configurations. The default pool uses inline flags in /etc/default/kubelet while additional pools use a separate config file (/etc/default/kubeletconfig.json). The NPD discovery script only reads from the inline flags file, missing the config file approach entirely.
To Reproduce Steps to reproduce the behavior:
- Create an AKS cluster with Kubernetes 1.31+
- Create additional system node pools:
az aks nodepool add \ --resource-group <resource-group> \ --cluster-name <cluster-name> \ --name syspoolzone2 \ --mode System - Create user node pools:
az aks nodepool add \ --resource-group <resource-group> \ --cluster-name <cluster-name> \ --name apppool \ --mode User - SSH to a node in an additional pool:
kubectl debug node/<additional-pool-node> \ -it \ --image=mcr.microsoft.com/cbl-mariner/busybox:2.0 \ --profile=sysadmin - Inside debug pod, access host filesystem:
chroot /host - Check kubelet configuration on additional pool:
cat /etc/default/kubelet | grep cluster-dns # No output - flag is missing - Compare with default pool:
# On default system pool node: cat /etc/default/kubelet | grep cluster-dns # Output: KUBELET_FLAGS=...--cluster-dns=10.52.0.10... - Check kubelet config file on additional pool:
cat /etc/default/kubeletconfig.json | grep clusterDNS # Output: "clusterDNS": ["10.52.0.10"] - Observe Node Problem Detector events:
kubectl get events --all-namespaces --field-selector reason=CoreDNSUnreachable - See persistent warnings on additional node pools only
Expected behavior All node pools should discover the correct CoreDNS service IP regardless of how the kubelet is configured (inline flags or config file), and DNS health checks should pass for all nodes.
Current behaviour Default system node pool:
- NPD discovers correct IP (example: 10.52.0.10) from inline
--cluster-dnsflag - DNS test still fails because node-level DNS cannot reach CoreDNS
- Events show:
dns test to coredns:10.52.0.10 over udp failed after 2 attempts
Additional system/user node pools:
- NPD discovers incorrect IP (10.0.0.10 - hardcoded fallback)
- DNS test fails with wrong IP
- Events show:
dns test to coredns:10.0.0.10 over udp failed after 2 attempts - Misleading warning suggests CoreDNS is unreachable when it's actually correctly configured
Additional context
Proposed Solution
Update NPD's check_dns_common.sh to add fallback logic for parsing /etc/default/kubeletconfig.json when inline --cluster-dns flag is not found:
Code Change
Add this logic after the existing kubelet flags check and before the "Validate IP format" comment:
# NEW: If still empty, try reading from kubelet config JSON file
if [ -z "$coredns_ip" ] && [ -f "/etc/default/kubeletconfig.json" ]; then
coredns_ip=$(grep -o '"clusterDNS"[[:space:]]*:[[:space:]]*\[[[:space:]]*"[0-9.]*"' /etc/default/kubeletconfig.json | \
grep -o '[0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}' | head -1)
fi
Rationale
- Uses only standard POSIX tools (grep, no jq dependency)
- Maintains existing code style and patterns
- Handles both single and multiple IPs in array
- Minimal performance impact
- Non-breaking change - only adds fallback capability
- Same IP regex pattern as existing kubelet flags check
Discovery Chain After Fix
1. Try iptables NAT rules
└─ Fails: Cilium eBPF has no NAT rules
2. Try LocalDNS corefile
└─ Fails: LocalDNS not enabled
3. Try /etc/default/kubelet inline flag
├─ Default pool: ✅ Succeeds
└─ Additional pools: Fails, continue
4. NEW: Try /etc/default/kubeletconfig.json
└─ Additional pools: ✅ Succeeds
5. Fallback to hardcoded 10.0.0.10
└─ Only reached if config completely missing
Workarounds
Enable LocalDNS
When LocalDNS feature becomes generally available:
- Request Azure subscription admin to register
LocalDNSPreviewfeature - Enable LocalDNS on node pools using updated AzAPI provider or Azure CLI
- LocalDNS provides proper node-level DNS resolution independent of NPD script discovery
Environment
Cluster Configuration:
- AKS Kubernetes version: 1.33.3
- Node OS: Azure Linux V3 (AKSAzureLinux-V3gen2-202511.07.0)
- Network plugin: Cilium with kube-proxy replacement mode
- CNI mode: eBPF
- VM SKU: Standard_D4as_v6
Affected Node Pools:
- System node pools: syspoolzone2, syspoolzone3
- User node pools: apppoolzone1, apppoolzone2, apppoolzone3
Unaffected:
- Default system node pool (zone 1) - uses legacy inline flags approach
Events Evidence
Events on Additional Pools
kubectl get events --all-namespaces --field-selector reason=CoreDNSUnreachable
NAMESPACE LAST SEEN TYPE REASON OBJECT MESSAGE
11m (recurring) Warning CoreDNSUnreachable node/aks-syspoolzone2-xxxxx-0 dns test to coredns:10.0.0.10 over udp failed after 2 attempts
11m (recurring) Warning CoreDNSUnreachable node/aks-syspoolzone3-xxxxx-0 dns test to coredns:10.0.0.10 over udp failed after 2 attempts
(repeating every 5 minutes)
Events on Default Pool
11m (recurring) Warning CoreDNSUnreachable node/aks-system-xxxxx-0 dns test to coredns:10.52.0.10 over udp failed after 2 attempts
Note: Even though zone 1 has the correct IP, it still fails because node-level DNS cannot reach CoreDNS (I think this is separate issue with node DNS configuration and Cilium eBPF and resolves itself after some time).
Technical Context
Cilium eBPF Impact
The issue is amplified (made visible) by Cilium's kube-proxy replacement:
- Traditional kube-proxy creates iptables NAT rules (NPD's first discovery method)
- Cilium eBPF bypasses iptables entirely
- With no iptables, NPD falls back to kubelet flags (second method)
- Missing flags cause discovery to fail on additional pools
Without Cilium eBPF, the iptables-based discovery would succeed on all pools, masking this configuration inconsistency.
Related Issues
- LocalDNS Feature: When enabled, will provide proper node-level DNS resolution independent of NPD script discovery (resolves both the discovery issue and underlying node DNS problem)
- Kubelet Configuration Standardization: Future AKS versions should standardize kubelet configuration approach across all node pool types
Suggested Next Steps
- Immediate: Update NPD scripts to support
/etc/default/kubeletconfig.jsonparsing - Short-term: Communicate known limitation in AKS documentation
- Medium-term: Promote LocalDNS feature as standard for all clusters?
- Long-term: Migrate default system pools to config file approach (breaking change for future major version)
@janlauber - Thank you for such amazing notes and investigation. Yes, we are aware of this issue and have created a PR with the fix. Due to holiday season, the rollout with the fix may get delayed. For now, the message can be ignored and does not have any other impact.
To be clear, kubeletconfig.json file is created on node with customization configuration. https://learn.microsoft.com/en-us/azure/aks/custom-node-configuration?tabs=linux-node-pools
@SriHarsha001 can you please provide an update, thanks!
Hi there thank you for responding. Are there any news regarding this? @SriHarsha001
My tickets waiting for a solution from microsoft are all several months old. 🥇
Sorry I missed to update this thread. The bug was fixed a month ago and had to wait for the rollout to start due to code freeze during holidays.
My tickets waiting for a solution from microsoft are all several months old. 🥇
Sorry for your experience, I request you to create a support case or follow up with the engineer working on your case for updates.
Sorry I missed to update this thread. The bug was fixed a month ago and had to wait for the rollout to start due to code freeze during holidays.
Sounds good, do you konw when this rollout will start?
Hi @SriHarsha001 , is there a plan to rollout the fix? We are facing a lot of issues on production due to this bug.
hey @SriHarsha001 we are also hitting this one
Apologize for the delay. I just got back to work this week.
This bug was fixed in Nov 2025 and should have been rolled out to all regions starting from 01/04/2026.
I created a new test cluster and verified the fix.
Please note - This is only a warning message that shows up in node events and should not have any impact to the availability of the node.
On my test cluster that I created today -
Inside the node -
cat /etc/default/kubeletconfig.json
"clusterDNS": [
"10.100.0.10"
],
kubectl get events --all-namespaces --field-selector reason=CoreDNSUnreachable
No resources found
Please perform node image update - https://learn.microsoft.com/en-us/azure/aks/upgrade-node-image to get the latest VHD.
cc @varora24
Thanks for the update. Closing this issue as resolved.
How do we check what node image this was fixed from?
Hi @tbertenshaw , You can track the rollout of AKS node image versions across regions using the AKS release tracker. Since this was fixed in the January release, you can upgrade to any node image version starting with 202601.XX. We recommend upgrading to the latest available image, as it includes the most recent security and CVE fixes.
We have the latest image version running on the cluster nodes but still seem to see this issue occuring as warning:
Did we mis something or is the bug not as fixed as this thread describes
Can you open the SR request as below with details?
Going to re-open as I think the SR automation didn't fire as this is closed.
@tom171296 please see the SR request. Thanks.
I think this is not done yet