我正在尝试在我的服务器(Debian 10)上安装一个 kubernetes 集群。在我的服务器上,我使用 ufw 作为防火墙。在创建集群之前,我在 ufw 上允许这些端口:
179/tcp、4789/udp、5473/tcp、443/tcp、6443/tcp、2379/tcp、4149/tcp、10250/tcp、10255/tcp、10256/tcp、90964/cpt
正如 calico doc 所建议的(https://docs.projectcalico.org/getting-started/kubernetes/requirements)和这个关于 kubernetes 安全性的 git repo(https://github.com/freach/kubernetes-security-best-practice) .
但是当我想创建集群时,由于 Felix 未上线,calico/node pod 无法启动(我在 ufw 上允许 9099/tcp):
Liveness 探测失败:calico/node 未准备好:Felix 未上线:获取http://localhost:9099/liveness:拨号 tcp [::1]:9099:连接:连接被拒绝
如果我禁用 ufw,则创建集群并且没有错误。
所以我想知道我应该如何配置 ufw 以便 kubernetes 工作。如果有人可以帮助我,那就太好了,谢谢!
编辑:我的 ufw 状态
To Action From
6443/tcp ALLOW Anywhere
9099 ALLOW Anywhere
179/tcp ALLOW Anywhere
4789/udp ALLOW Anywhere
5473/tcp ALLOW Anywhere
2379/tcp ALLOW Anywhere
8181 ALLOW Anywhere
8080 ALLOW Anywhere
###### (v6) LIMIT Anywhere (v6) …Run Code Online (Sandbox Code Playgroud)