Calico Calico node unable to resolve DNS.

Calico node lacks proper DNS configuration or access to a DNS server.

Understanding Calico

Calico is a powerful open-source networking and network security solution for containers, virtual machines, and native host-based workloads. It is designed to provide a scalable networking fabric across a range of environments, including Kubernetes, OpenShift, and OpenStack. Calico leverages the Linux kernel's native capabilities to deliver high-performance networking and security policies.

Identifying the Symptom

One common issue that users may encounter when using Calico is the inability of a Calico node to resolve DNS. This problem manifests as network connectivity issues, where services or applications running on the node cannot reach external resources or other nodes within the cluster due to DNS resolution failures.

Exploring the Issue: CALICO-1021

The error code CALICO-1021 indicates that a Calico node is unable to resolve DNS queries. This can severely impact the functionality of applications relying on DNS for service discovery and external communication. The root cause often lies in misconfigured DNS settings or lack of access to a DNS server.

Common Causes

  • Incorrect DNS server IP addresses configured on the node.
  • Network policies blocking DNS traffic.
  • DNS server unavailability or misconfiguration.

Steps to Resolve the DNS Issue

To resolve the DNS resolution issue on a Calico node, follow these steps:

Step 1: Verify DNS Configuration

Check the DNS configuration on the affected node. Ensure that the DNS server IP addresses are correctly specified in the /etc/resolv.conf file. You can view the file using:

cat /etc/resolv.conf

Ensure that the DNS server IPs are reachable and correct.

Step 2: Test DNS Connectivity

Use the nslookup or dig command to test DNS resolution from the node:

nslookup google.com

If the command fails, it indicates a DNS resolution problem.

Step 3: Check Network Policies

Ensure that Calico network policies are not blocking DNS traffic. Review the policies using:

calicoctl get networkpolicy -o yaml

Adjust the policies to allow DNS traffic if necessary.

Step 4: Verify DNS Server Availability

Ensure that the DNS server is operational and accessible from the node. You can ping the DNS server to check its availability:

ping <dns-server-ip>

If the server is unreachable, investigate network connectivity issues.

Additional Resources

For more information on configuring DNS in Kubernetes, refer to the official Kubernetes DNS documentation. Additionally, the Calico documentation provides comprehensive guidance on network policy management and troubleshooting.

Master

Calico

in Minutes — Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the whitepaper on your email!
Oops! Something went wrong while submitting the form.

Calico

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the whitepaper on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid