2016-08-20 193 views
0

我設置了一個Kubernetes集羣以下Kelseys實驗室開始:https://github.com/kelseyhightower/kubernetes-the-hard-wayiptables的錯誤阻止吊艙在Kubernetes

我只設置了一個節點爲止。當試圖部署波德,下面的錯誤阻止它入門:

Warning FailedSync Error syncing pod, skipping: failed to "SetupNetwork" for "nginx-3137573019-pjbie_default" with SetupNetworkError: "Failed to setup network for pod \"nginx-3137573019-pjbie_default(b4128fc1-6707-11e6-a8b3-005056a2068d)\" using network plugins \"kubenet\": Failed to execute iptables-restore: exit status 1 (Can't open /tmp/kube-temp-iptables-restore-214792160: Permission denied\n); Skipping pod"

的kubelet以root身份運行。日誌中提到的文件也屬於根目錄。

是Linux系統OEL 7(內核:UEK 4.1.12)

有沒有人有一個想法,什麼原因可能是,或如何進一步調查?

回答

2

聽起來像SELinux阻止kubelet在IPtables上執行更改。搜索/var/log/audit/audit.log中包含字符串'AVC'的消息以確認該理論。

最簡單的解決方法是使用shell命令setenforce 0完全禁用SELinux。這無法在重新啓動後存活,因此請確保您也禁用了/etc/selinux/config中的SELinux。

如果你不想完全禁用SELinux,這我建議,你將不得不爲了建立自己的SELinux模塊kubeletkube-proxy使用的工具,如audit2allowsemodule

檢查這些文獻爲進一步指導:

+0

這奏效了,謝謝! – fischerman

相關問題