Implementing iptables rules on Kubernetes nodes

拥有回忆 提交于 2019-12-01 21:13:35

问题


I would like to implement my own iptables rules before Kubernetes (kube-proxy) start doing it's magic and dynamically create rules based on services/pods running on the node. The kube-proxy is running in --proxy-mode=iptables.

Whenever I tried to load rules when booting up the node, for example in the INPUT chain, the Kubernetes rules (KUBE-EXTERNAL-SERVICES and KUBE-FIREWALL) are inserted on top of the chain even though my rules were also with -I flag.

What am I missing or doing wrong?

If it is somehow related, I am using weave-net plugin for the pod network.


回答1:


The most common practice is to put all custom firewall rules on the gateway(ADC) or into cloud security groups. The rest of the cluster security is implemented by other features, like Network Policy (It depends on the network providers), Ingress, RBAC and others.

Check out the articles about Securing a Cluster and Kubernetes Security - Best Practice Guide.

These articles can also be helpful to secure your cluster:

  • Hardening your cluster's security

  • The Ultimate Guide to Kubernetes Security



来源:https://stackoverflow.com/questions/51857978/implementing-iptables-rules-on-kubernetes-nodes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!