【问题标题】:Iptables error prevents Pod starting in Kubernetesiptables 错误阻止 Pod 在 Kubernetes 中启动
【发布时间】:2016-08-21 19:14:31
【问题描述】:

我正在按照 Kelseys Lab 设置 Kubernetes 集群:https://github.com/kelseyhightower/kubernetes-the-hard-way

到目前为止,我只设置了一个节点。尝试部署 Pod 时,出现以下错误,导致无法启动:

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 身份运行。日志中提到的文件也属于root。

系统是 Linux OEL 7(内核:UEK 4.1.12)

有没有人知道原因可能是什么或如何进一步调查?

【问题讨论】:

    标签: linux kubernetes iptables


    【解决方案1】:

    听起来 SELinux 正在阻止 kubelet 对 IPtables 执行更改。在/var/log/audit/audit.log 中搜索包含字符串“AVC”的消息以确认该理论。

    最简单的解决方法是使用 shell 命令setenforce 0 完全禁用 SELinux。这不会在重新启动后继续存在,因此请确保您还在 /etc/selinux/config 中禁用 SELinux。

    如果您不想完全禁用 SELinux,我建议您这样做,您必须使用 audit2allowsemodule 等工具来为 kubeletkube-proxy 构建自己的 SELinux 模块.

    查看这些参考资料以获得更多指导:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-19
      • 1970-01-01
      • 1970-01-01
      • 2020-02-15
      相关资源
      最近更新 更多