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


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.