为什么安装k8s需要关闭selinux

为什么使用kubeadm安装k8s需要关闭selinux

在使用kubeadm安装k8s集群的时候,准备工作里有一项要求关闭selinux,说是如果不关闭会导致k8s安装失败。但是都没有提到为什么会失败。

# 关闭Selinux
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

希望大神门能给个解释

阅读 7.4k
1 个回答
新手上路,请多包涵

参考官方文档:https://kubernetes.io/docs/se...

Setting SELinux in permissive mode by runningsetenforce 0andsed ...effectively disables it. This is required to allow containers to access the host filesystem, which is needed by pod networks for example. You have to do this until SELinux support is improved in the kubelet.

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进