Warning FailedCreatePodSandBox 19m (x6068 over 24h) kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox xx: plugin type=”flannel” failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory

When you setup your kubernetes cluster with flannel plugin as your CNI interface, you will have to make sure the file /run/flannel/subnet.env exists in all your kubernetes worker nodes. Otherwise, the pods that you create will be in forever ‘ContainerCreating’ state.

sudo vim /run/flannel/subnet.env

And paste the below four lines and save it

FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true

Now when you run kubectl get pods, your pods status should be in running state.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.