azurekubernetesazure-acswindows-server-container

Azure ACS Kubernetes Windows Containers delayed access to internet


I used the Azure portal to create an Azure ACS for windows containers yesterday 4/19/17. I find that whenever I deploy to it the container can't reach the internet for 2-3 minutes. I logged in to one of the nodes and manual created a container from the same image and it instantly can access the internet.

One difference I see is that the kubernetes owned containers contain an additional transparentNet where the plain docker container only has a nat network.

This is the test code I'm running

 static void Main(string[] args)
    {
        var connectedStopWatch = new Stopwatch();
        var disconnectedStopWatch = new Stopwatch();
        while (true)
        {
            try
            {
                using (var wc = new WebClient())
                {
                    wc.DownloadString("http://google.com");
                    connectedStopWatch.Start();
                }
                Console.WriteLine($"Connected for {connectedStopWatch.ElapsedMilliseconds} ms");
            }
            catch (WebException e)
            {
                connectedStopWatch.Stop();
                disconnectedStopWatch.Start();
                Console.WriteLine($"Disconnected for {disconnectedStopWatch.ElapsedMilliseconds} ms");
            }
            Thread.Sleep(5000);
        }
    }

Dockerfile

FROM microsoft/windowsservercore
COPY ConnectionTest.exe /
ENTRYPOINT ConnectionTest.exe

Does anyone know what could be causing the delay in accessing the internet from the container?


Solution

  • This is a known issue tracked here: https://github.com/Azure/acs-engine/issues/519. We are testing a fix for this issue here, but will soon integrate into acs-engine: https://github.com/JiangtianLi/acs-engine/commits/jiangtli-winnat.