昨天4/19/19我使用Azure门户为windows容器创建Azure ACS。我发现无论何时我部署它,容器都无法连接到互联网2-3分钟。我登录到其中一个节点并手动创建了一个来自同一图像的容器,它可以立即访问互联网。Azure ACS Kubernetes Windows Containers延迟访问互联网
我看到的一个区别是,kubernetes拥有的容器包含一个额外的transparentNet,其中普通码头集装箱只有一个nat网络。
这是测试代码,我跑
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
有谁知道什么可能会导致从容器访问互联网的延迟?
Azure需要一段时间才能设置和传播所需的工件,当您仅使用Docker启动容器时,您只需使用这些工件。 –
任何想法这些工件将会是什么或者如果有办法看到我在等待什么?集群本身已经运行了一天。 –
在启动过程中,类型kubectl会描述以查看它正在分配哪些资源。这里还显示延迟。 –