kelseyhightower / kubernetes-the-hard-way

Bootstrap Kubernetes the hard way. No scripts.
Apache License 2.0
41.26k stars 14.12k forks source link

Why only start one coredns, pod cannot communicate across nodes? #650

Closed wajika closed 3 years ago

wajika commented 3 years ago

I have two worker nodes and use flannel to communicate. If coredns is deployed on worker node2, the pod on worker node1 cannot communicate with apiserver. Why?

image

Busybox is on node1 and coredns is on node2, busybox cannot resolve kubernetes addresses.

微信截图_20210407115608

If busybox and coredns are on the same node, then pod can communicate.

wajika commented 3 years ago

The problem has been solved and the controller manager failed to allocate pod CIDR.

The following two parameters should be set at the same time:

--allocate-node-cidrs=true --cluster-cidr=X.X.X.X/16