Azure ACS Kubernetes Windows Containers delayed access to internet

旧街凉风 提交于 2020-01-05 04:41:06

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/43526975/azure-acs-kubernetes-windows-containers-delayed-access-to-internet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!