Kubernetes service can't connect to external services or internet

3/31/2020

My ASP.NET Core Api webapplications can't connect to any server outside the cluster. Even access to the internet seems to be blocked. This problem only occurs when the my application is hosted in my on-premis Ubuntu cluster. When running in the docker desktop cluster everything is working ok.

I have setup a basic Kubernetes cluster on 2 Unbuntu 18.04 servers running as Hyper-V nodes on my Window developer machine. I'm using calico as my network overlay. I've installed Calico according the Quick Start method. My application is deployed as nodeport and is working well. I can access all of my controllers. But when I try to connect to, for example an SQL Server running outside the cluster I receive a timeout.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server) Inner exception [A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server

Even when a controller method accessing to google.com using an HttpClient is timed out.

kubectl logs -n kube-system coredns

[ERROR] plugin/errors: 2 google.nl. AAAA: read udp 192.168.237.199:60244->192.168.100.36:53: i/o timeout
[ERROR] plugin/errors: 2 google.nl. A: read udp 192.168.237.199:59045->192.168.100.36:53: i/o timeout
[ERROR] plugin/errors: 2 google.nl. AAAA: read udp 192.168.237.199:58190->192.168.100.36:53: i/o timeout
[ERROR] plugin/errors: 2 google.nl. A: read udp 192.168.237.199:53982->192.168.100.36:53: i/o timeout

So it seems something is blocking all these requests. I disabled the Ubuntu firewalls already on my Ubuntu machines. So somethingelse is blocking. But I can't figure out what went wrong.

Any help would be appreciated.

-- Marcel Beeker
calico
kubernetes

0 Answers