Can't Access Internet on Kubernetes Pods: Troubleshooting Network Configuration

Abstract: Resolve Kubernetes pod internet connectivity failures by diagnosing node-level routing, CNI plugin status, and CoreDNS configuration.

Created: 2026-10-06 by
Kubernetes pods often lose internet access due to misconfigured CNI plugins, incorrect DNS settings, or restrictive network policies. This guide walks you through the essential diagnostic steps to restore connectivity by verifying node-level networking, inspecting pod DNS resolution, and auditing firewall rules on your cluster nodes.

Verify Node-Level Connectivity

Before diving into Kubernetes-specific configurations, you must ensure that the underlying infrastructure can reach the internet. The most common cause of pod isolation is a failure at the host level rather than within the cluster itself. If the worker nodes cannot route traffic externally, no amount of Kubernetes configuration will fix the issue for the pods scheduled on those nodes. Start by accessing one of the affected worker nodes via SSH. You should attempt a basic ping to an external IP address, such as 8.8.8.8, to test raw network reachability. Simultaneously, try resolving a domain name using nslookup google.com or dig google.com. If these commands fail, the problem lies with the node’s network interface, routing table, or local firewall rules (such as iptables or firewalld). Check the node’s default gateway using ip route to ensure it points to the correct upstream router. In cloud environments, verify that the security groups or network ACLs associated with the instance allow outbound traffic on ports 53 (DNS) and 443/80 (HTTP/HTTPS). If node-level connectivity is confirmed, proceed to check if the issue is isolated to specific nodes or affects the entire cluster. Run the connectivity tests on multiple nodes to rule out hardware or network switch failures affecting a single data path.

Inspect Cluster Network Configuration

Once node connectivity is established, the next step is to examine how Kubernetes handles pod networking. Most clusters rely on a Container Network Interface (CNI) plugin like Calico, Flannel, Cilium, or Weave Net. A broken CNI installation or a version mismatch between the CNI and the Kubernetes version is a frequent culprit for silent packet drops. Check the status of your CNI pods running in the kube-system namespace. Use kubectl get pods -n kube-system and look for components like calico-node or flannel. Ensure they are in a Running state and not restarting frequently. If a CNI pod is crashing, check its logs with kubectl logs <pod-name> -n kube-system for errors related to IP allocation or interface creation. Additionally, verify that the CNI has successfully allocated IP addresses to your pods. Describe a problematic pod using kubectl describe pod <pod-name> and look at the events section. If you see errors about failing to allocate an IP or creating network interfaces, the CNI plugin may be misconfigured. Ensure that the pod’s network namespace is correctly linked to the host’s bridge or overlay network. For example, in Flannel-based clusters, check that the cni0 bridge exists on the node and has the correct subnet configured.

Diagnose DNS Resolution Issues

Even with perfect network routing, pods cannot access the internet if they cannot resolve domain names. Kubernetes uses CoreDNS as the default DNS provider, and misconfigurations here often manifest as timeouts when trying to reach external services. To test DNS from within a pod, exec into a busybox or debug container and run nslookup kubernetes.default followed by nslookup google.com. If the first command succeeds but the second fails, the issue is likely with external DNS forwarding. Check the CoreDNS deployment in the kube-system namespace. Inspect its ConfigMap to ensure the forward directive points to valid upstream DNS servers, such as 8.8.8.8 or 1.1.1.1. If both lookups fail, the CoreDNS service itself might be unreachable or crashed. Verify that the kube-dns or coredns service has an active endpoint. Sometimes, network policies inadvertently block traffic to the DNS service on port 53 UDP/TCP. Review any applied NetworkPolicies to ensure they allow egress from pods to the kube-system namespace on port 53.

Audit Network Policies and Firewalls

NetworkPolicies are powerful tools for restricting traffic, but they are also a common source of accidental lockouts. By default, if no NetworkPolicy is defined, all traffic is allowed. However, if you have applied even a single policy, it may restrict egress traffic to the internet. List all NetworkPolicies in your namespaces using kubectl get networkpolicies --all-namespaces. Examine each policy to see if it includes an egress rule. A restrictive egress rule might only allow traffic to internal services, blocking all external HTTP/HTTPS requests. To test if a policy is the cause, temporarily remove the offending policy using kubectl delete networkpolicy <name> and retry the internet access test. If connectivity returns, you need to update the policy to explicitly allow egress to 0.0.0.0/0 on ports 80 and 443. Similarly, check for global network policies or third-party firewall solutions integrated with your cloud provider. Some enterprise Kubernetes platforms enforce strict egress filtering at the cluster level. Consult your platform documentation to identify if there are global deny-all rules that override individual pod configurations.

Test with a Minimal Pod

When troubleshooting complex networking issues, isolating variables is crucial. Create a minimal pod using a simple image like busybox to eliminate application-specific code as a variable. Deploy this pod without any custom labels or selectors to ensure it is not targeted by existing NetworkPolicies. Run the following command to create a test pod:
kubectl run test-internet --image=busybox --command -- sleep 3600
Once the pod is running, exec into it and perform the connectivity tests again. Ping 8.8.8.8 and try to download a file using wget or curl. If this minimal pod works while others do not, the issue is likely related to specific labels, namespaces, or resource limits assigned to the failing workloads. If the minimal pod also fails, the problem is systemic to the cluster’s network plane. For more insights on general networking diagnostics, you might find our guide on Ping Strange Behavior: Troubleshooting Networking and DNS Issues helpful for understanding packet loss patterns. Additionally, if you suspect broader infrastructure issues, reviewing Troubleshooting Website Access Between Two Offices on Different Subnets can provide techniques for diagnosing cross-subnet routing problems that may apply to your node-to-internet path.

Frequently Asked Questions

Why can I ping an IP but not a domain name?

This indicates that network routing is working, but DNS resolution is failing. Check your CoreDNS configuration and ensure the forward directive points to reliable upstream servers. Also, verify that no NetworkPolicy is blocking UDP port 53 traffic from the pod.

How do I check if a CNI plugin is installed correctly?

You can verify the CNI status by listing pods in the kube-system namespace. Look for components like calico-node or flannel and ensure they are running without restarts. Check their logs for errors related to IP allocation or interface binding.

Can a NetworkPolicy block internet access?

Yes, if a NetworkPolicy defines an egress rule, it denies all traffic not explicitly allowed. Ensure your policy includes an egress entry for ports 80 and 443 to destinations like 0.0.0.0/0. Removing the policy temporarily can help confirm if it is the cause.

What should I do if all pods on a node lose connectivity?

If all pods on a specific node are affected, the issue is likely at the node level. Check the node’s network interface, routing table, and local firewall rules. Test connectivity directly from the node’s shell to determine if the host itself can reach the internet.

Is it safe to disable NetworkPolicies during troubleshooting?

It is generally safe to temporarily remove restrictive NetworkPolicies for debugging purposes, provided your environment is not exposed to untrusted public traffic. Always reapply the necessary policies immediately after identifying the root cause to maintain security.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More