How Do You Get Nodes in Kubernetes to Be Ready with a Network Plugin Error?

Problem scenario
Your pods are not ready in Kubernetes. "kubectl describe pods" results may have errors like this:

Warning FailedCreatePodSandBox 4m57s (x2035 over 69m) kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "abcd1234" network for pod "apache-tomcat-deployment": networkPlugin cni failed to set up pod "apache-tomcat-deployment" network: open /run/flannel/subnet.env: no such file or directory

(The symptoms of this problem will involve pods and nodes not being ready. You may go to an load balancer URL, but the page will not load. It is supposed to be an ingress to a Kubernetes web application. You expect to see a regular web page.)

What should you do?

Create the /run/flannel/subnet.env file. The pods will come back right away without you doing anything.

Here is the content of the file:


echo "
FLANNEL_IPMASQ=true" > /run/flannel/subnet.env 

Leave a comment

Your email address will not be published. Required fields are marked *