PaaS/Kubernetes

(Kubernetes) kubernetes 10.96.0.1 no route to host --DEBUG

armyost 2021. 7. 21. 06:09
728x90

At first time, I did trouble-shoot for solving rror "kubedns container cannot connect to apiserver"

When I check the error. I can figure out that pod cannot communicate with cluster-service-network-cidr.

 

My pod network was 10.244.0.0/16 And my service network was 10.96.0.0/16.

When regular situation, routing of between them can be possible.

But the two network cannot communicate each other in my case.  

 

 

I think that it is caused by conflict in iptables.(firewalld is upper level tool of iptable from Centos7. It can make some troubles)

So I did many things and solve it finally.

 

Here is what I did bellow.

 

My Kubernetes Version is 1.21 

My CentOS Version is 7.6.1810

 

 

first I did.


# systemctl stop kubelet
# systemctl stop docker
# iptables --flush
# iptables -tnat --flush
# systemctl start kubelet
# systemctl start docker

But It was useless

 

So I did this on Master/Worker Node


# systemctl stop firewalld

It works!

 

 

So I feel that I should control iptables with iptables.service not firewalld.service from next time.