解決k8s的nodePort,外網不能訪問


 

 

官方原文:
Disabling SELinux by running setenforce 0 is required to allow containers to access the host filesystem, which is required by pod networks for example. You have to do this until SELinux support is improved in the kubelet.
翻譯就是
通過setenforce 0 關閉SELinux是必須的,這樣容器才可以訪問主機的文件系統,例如pod的網絡操作就需要訪問主機文件系統。直到kubelet支持SELinux之前你都需要關閉SELinux。

iptables --flushiptables -tnat --flush是清空iptables的規則,然后重啟docker后會重新加入kubernetes的iptables規則,iptables -P FORWARD ACCEPT則允許轉發

iptables --flush&iptables -tnat --flush & iptables -P FORWARD ACCEPT

 



iptables --flush& iptables -tnat --flush & iptables -P FORWARD ACCEPT

 


iptables -P FORWARD ACCEPT


免責聲明!

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



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