Watch
0
0
Fork
You've already forked hyperhive
0

egress: the forward chain accepts the flows the host publishes for the agents

On a host with the egress intercept on, the forward chain rejected an agent's traffic to the queue once the queue ran as a pod: the pod's hostPort rewrites the destination to the pod, and the packet then leaves the bridge for the cluster. The chain now accepts TCP that the host's NAT redirected whose original destination is the bridge's address at a published port, which the queue adds when it runs in the cluster. Everything else from the bridge to the cluster stays refused. The nats switch test runs with the intercept on.
This commit is contained in:
atlas 2026-11-23 18:40:04 +01:00 • committed by maia
commit ec7514fc5a

View file

@ -1618,6 +1618,10 @@ in
# The pod's client `hostPort` is a DNAT rule, which the INPUT rules above
# never see: ./lib/swarm-nats-raw-rules.nix gives it the container's reach.
services.hyperhive.network.enable = lib.mkIf onK8s (lib.mkDefault true);
# An agent dials the queue at the bridge's address; the pod's `hostPort` is
# forwarded to the cluster, which the egress forward chain would refuse.
services.hyperhive.deploy.hive-controller.egress.publishedPorts = lib.mkIf onK8s [ cfg.port ];
networking.firewall.extraCommands = lib.mkIf onK8s (
import ./lib/swarm-nats-raw-rules.nix { inherit lib; } {
chain = "nixos-fw-nats";