<p>I deployed a kubernetes cluster (v1.11) in a hybrid environment connected by aws direct connect service. There are 3 ec2 nodes in one vpc and another bare metal server.</p>

<p>Every thing works will except the bad network. I have some java web services running in kubernetes and I set <code>nodeSelector</code> to make all of them running in ec2. And there had shown a lot of <code>java.net.UnknownHostException</code> when the service trying to access some services through http. It did not happen every time but it is quite frequent.</p>

<p>I tried some method to check the problem. For example, I checked the coredns service, and found out a lot of timeout over there. I solved the timeout problem by following <a href="https://github.com/kubernetes/kubeadm/issues/193" rel="nofollow noreferrer">this issue</a> but the <code>java.net.UnknownHostException</code> is still shown.</p>

<p>I also found <a href="https://aws.amazon.com/cn/blogs/opensource/unified-service-discovery-ecs-kubernetes/" rel="nofollow noreferrer">this link</a> but I am not sure if this is related with my problem.</p>

<p>Hope someone can solve my problem. I do suffer a lot of this. Thanks in advance.</p>

<p>And recently I found some one has similar problem with me, it may related with the <code>coredns</code> in kubernetes.</p>

aisensiy
<p>Switch cni plugin from flannel to calico solved this problem.</p>
