Kubelet can't create a pod, flannel used with specific pod network

I’ve setup a new cluster with rancher 2.x, in the cluster yaml file, I’ve changed the service and pod network with 2 /24.
Everything was OK until I tryed to schedule a pod

I’ve these logs in the kubect describe pod command

Normal Scheduled default-scheduler Successfully assigned preprod/cow1-7894cc994c-xgr56 to XXXXXXXXXXX
Warning FailedCreatePodSandBox 2m7s kubelet, XXXXXXXXXXX Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container “7ed158d7677f2e1ed4b5eb8b0e24cf2afdd8d68c147bd55b8d1dc81d56a7c2c3” network for pod “cow1-7894cc994c-xgr56”: networkPlugin cni failed to set up pod “cow1-7894cc994c-xgr56_preprod” network: no podCidr for node XXXXXXXXXXX

Any clue ?


The default layout is a /16 because each node gets allocated a /24 from the podCidr for the pods that will go on that node. If you change the podCidr to a /24, you now have space for exactly one node.

Hi Vincent,
Thx for your answer ! This means that a should have room for pods only if I have one worker node.
What is the best way to update the pod and service network once the cluster is up ?? Stop all pods, update the rancher config, and clean up the etcd ? do you know wich key I have to delete from etcd ?


FYI, we tested a /24 for pods network, only with one worker node, but it doesn t work …
We saw a /21 network (using docker network command) used by (it seems) kube-system pods. This one is defined nowhere in rancher … strange …