Kubernetes 報錯:"open /run/flannel/subnet.env: no such file or directory"


pod 一直處於 'ContainerCreating',查看 pod 詳情:

kubectl describe pod [pod name]

提示錯誤信息:

... 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 ...

解決方法:

查看是否有 /run/flannel/subnet.env 這個文件,master 上是存在的,也有內容:

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

各個 worker 節點上沒有此文件,創建目錄,新建文件,拷貝文件內容,然后重新創建 pod,正常了。




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM