Kubernetes error: "open /run/flannel/subnet.env: no such file or directory"
The pod has been in 'ContainerCreating', check the pod details:
kubectl describe pod [pod name]
Prompt error message:
...NetworkPlugin cni failed to set up pod "mysql-mb6t7_default" network: open /run/flannel/subnet.env: no such file or directory
1608 cni.go:228] Error while adding to cni network: open /run/flannel/subnet.env: no such file or directory...
Solution:
Check if there is /run/flannel/subnet.envthis file, it exists on the master, and it also has content:
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
There is no such file on each worker node. Create a directory, create a new file, copy the file content, and then recreate the pod, which is normal.
0 Comments