-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
siderolabs/talos
#8559Description
There's a potential issue where Kubernetes components, such as kubelet and kube-proxy, are using legacy iptables, while the Talos Ingress Firewall is utilizing nftables. That means both x_tables and nf_tables kernel subsystems get used at the same time, which could potentially lead to unpredictable behavior or conflicts.
I've been able to track the cause of this down to kubelet base image:
Line 31 in 981b856
FROM registry.k8s.io/build-image/debian-iptables:bookworm-v1.0.0 as container |
On the first invocation of iptables in that image
/usr/sbin/iptables-wrapper
script gets run. That script decides between _legacy and _nft version of iptables, based on the length of the already created rules. If they are empty (which I think is the case when kubelet on Talos starts up) the script chooses legacy version:
$ docker run --rm -it registry.k8s.io/build-image/debian-iptables:bookworm-v1.0.0 iptables --version
iptables v1.8.9 (legacy)
To fix the issue please consider one of the following solutions:
- Force iptables-nft at build time in the Dockerfile:
update-alternatives --set iptables "/usr/sbin/iptables-nft"
update-alternatives --set ip6tables "/usr/sbin/ip6tables-nft"
- Use an image with updated version of
/usr/sbin/iptables-wrapper
which favors nftables. For example this one:
$ docker run --rm -it registry.k8s.io/build-image/distroless-iptables:v0.5.2 iptables --version
iptables v1.8.9 (nf_tables)