Skip to content

"/run/flannel/subnet.env: no such file or directory" pod creation error upon installing flannel #2232

Open
@SpiderUnderUrBed

Description

@SpiderUnderUrBed

Warning FailedCreatePodSandBox 3m15s (x17 over 6m45s) kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c981dd6fab7e72250f444f4e41aaa1d9761c0be4f5e493b6a3dccc326c952ff3": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
When I run:
kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml
or:

# Needs manual creation of namespace to avoid helm error
kubectl create ns kube-flannel
kubectl label --overwrite ns kube-flannel pod-security.kubernetes.io/enforce=privileged

helm repo add flannel https://flannel-io.github.io/flannel/
helm install flannel --set podCidr="10.244.0.0/16" --namespace kube-flannel flannel/flannel

I get this error, as in all my pods are stuck creating, with this error:
Warning FailedCreatePodSandBox 3m15s (x17 over 6m45s) kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c981dd6fab7e72250f444f4e41aaa1d9761c0be4f5e493b6a3dccc326c952ff3": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
This is recently installed too, on k3s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions