I’ve set up a couple of Kubernetes clusters with firewall interfaces like ufw
, iptables
, nftables
, etc.
Recently, I set up the first cluster running on NixOS.
I cannot enable the NixOS-managed firewall without the cluster becoming unreachable.
From the pods’ logs, it seems like all internal traffic is blocked, as well. Not sure.
In the process of debugging this & trying to make the situation work, I punched so many holes into the firewall with tons of allow rules for wide ranges of TCP & UDP ports. It’s way too much, but I wanted to make this work.
Now, even with all these holes, it still won’t work. Perhaps, because all the ports wouldn’t help, if the internal traffic is entirely blocked, as well or something resembling this behaviour.
Is there something obvious about NixOS’ firewall management I am missing?
If not, I’ll have to debug this really manually in an extremely circuitous way…
This is how the scenario looks like:
- Firewall is disabled.
Everything works. - Firewall is enabled.
Getting log messages with health checks failing, becauseClusterIP:Port
is unreachable. These are internal addresses, not reachable from the outside. - Firewall is disabled.
Health checks start working again. Everything works.