Kubernetes NodePort - Ufw/Iptables 被忽略了吗?

Kubernetes NodePort - Ufw/Iptables ignored?

我在一台机器上打开了一个 Kubernetes NodePort 并使用以下规则阻止了到该端口的所有流量:

sudo ufw deny 30001

但我仍然可以通过浏览器访问该端口。常见吗?我在文档中找不到任何相关信息。

终于找到问题所在:kube-proxy 正在编写 iptables 规则 (https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/#is-kube-proxy-writing-iptables-rules),这些规则在手动添加的 ufw 规则之前被捕获。这可以通过检查 iptables -S -v.

输出中的顺序来确认