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.
Every thing works will except the bad network. I have some java web services running in kubernetes and I set nodeSelector
to make all of them running in ec2. And there had shown a lot of java.net.UnknownHostException
when the service trying to access some services through http. It did not happen every time but it is quite frequent.
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 this issue but the java.net.UnknownHostException
is still shown.
I also found this link but I am not sure if this is related with my problem.
Hope someone can solve my problem. I do suffer a lot of this. Thanks in advance.
And recently I found some one has similar problem with me, it may related with the coredns
in kubernetes.
Switch cni plugin from flannel to calico solved this problem.