0

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
  • 163
  • 1
  • 13
  • This problem is only with the ASP.NET app? Have you tried deploying an simple nginx `pod` to test the connection? – Crou Mar 31 '20 at 11:40
  • We believe is a general problem connecting from a Pod to the outside world. – Marcel Beeker Mar 31 '20 at 12:26
  • 3
    Can you test so we don't waist time trying to fix unrelated problem? – Crou Mar 31 '20 at 12:34
  • I don't know much about Calico, but it sounds like something with Calico outbound traffic configuration. Please check this out: https://docs.projectcalico.org/reference/faq#how-can-i-enable-nat-for-outgoing-traffic-from-containers-with-private-ip-addresses – Sebin Mar 31 '20 at 14:22
  • 1
    @Crou I will try. As soon as I get the result, I let you know. – Marcel Beeker Apr 01 '20 at 13:36

0 Answers0