k3s nftables rule of ingress controller bypasses host nftables #10693
Replies: 3 comments
-
These rules are all managed by kube-proxy. I would probably take your question upstream to the Kubernetes project. |
Beta Was this translation helpful? Give feedback.
-
I think your document or k8s document should tell which tool should be used as firewall A few days ago when I added a rule using Second thing is if we try # Warning: iptables-legacy tables present, use iptables-legacy-save to see them because of these two, I tried |
Beta Was this translation helpful? Give feedback.
-
I found great detail here KEP-3866: Add an nftables-based kube-proxy backend kube-proxy uses iptables but in its nftable API mode 1 -- which means the API being used is nftable but only iptables feature can be used . Kube-proxy has planned to move to nftable 2 |
Beta Was this translation helpful? Give feedback.
-
A new traefik entrypoint (5050/tcp) has been added via helm
The ingress-controller (traefik) should load-balance 5050/tcp to some pods (using ingressRouteTCP CRD) but not always. Sometime there is need to block all incoming ports.
The issue is that when the
inet
chain of nftable policy set todrop
the port5050/tcp
is still accessiblefurther checking shows that k3s (or upstream k8s) nftable rules are added to
nat
tablethe cause are
because of these rules , the
filter
tableinet
chain is ignored andpolicy drop
has no effect for80
,443
,5050
or any other entrypointsI am curious why this way ?
It is possible to block these ports in
mangle
table but filtering should be done infilter
table notmangle
by the way if we delete the
nat
rule, a few minutes later the rule will be added tonat
tableBeta Was this translation helpful? Give feedback.
All reactions