Azure ACS Kubernetes Windows容器延迟了Internet访问 [英] Azure ACS Kubernetes Windows Containers delayed access to internet
问题描述
昨天4/19/17,我使用Azure门户为Windows容器创建了Azure ACS.我发现,每当部署到该容器时,该容器在2-3分钟内都无法连接到Internet.我登录到其中一个节点,并使用同一张图片手动创建了一个容器,它可以立即访问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.
我看到的一个区别是,kubernetes拥有的容器包含一个附加的transparentNet,其中普通docker容器仅具有nat网络.
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
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?
推荐答案
这是在此处跟踪的一个已知问题: https://github.com/JiangtianLi/acs-engine/commits/jiangtli-winnat .
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.
这篇关于Azure ACS Kubernetes Windows容器延迟了Internet访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!