atunnel: bind actor ingress/egress listeners dual-stack (:port) - #978
atunnel: bind actor ingress/egress listeners dual-stack (:port)#978SURAJ KUMAR (krsnaSuraj) wants to merge 1 commit into
Conversation
Default atunnel-listen-address to :443 and atunnel-egress-listen-address to :15001 in both ateom binaries so listeners accept IPv6 + IPv4 on dual-stack clusters and exist on IPv6-only clusters. 0.0.0.0 bound only an IPv4 wildcard, breaking IPv6-only pod networks and dropping the IPv6 leg on dual-stack. Update atecontroller workerpool apply path that passed the old values as explicit flag overrides, plus its expected-args test. Fixes: agent-substrate#943
|
Thanks for picking this up. Two notes, one procedural and one technical. I had a branch for this predating the issue and have now opened it as #1042 — the same ingress change, plus a test that pins both listen addresses so the default can't drift back silently. Flagging the overlap so review isn't duplicated; maintainers should take whichever they prefer. On the egress half, I'd suggest dropping it from this PR. It is inert today — the actor interior veth is IPv4-only and the REDIRECT feeding 15001 is an IPv4 nftables rule, so nothing can reach that listener over v6. It stops being inert the moment your #979 lands: |
|
Thanks for the thorough review — both points are correct, and #1042 is strictly the better change. I verified the actor interior veth is IPv4-only and the REDIRECT into 15001 is an IPv4 nftables rule, so the dual-stack egress listener in #978 is indeed inert today and would become an accepted-then-failed flow once #979 lands and #686/#753 are still open. The egress half is out — I'm closing #978 in favor of #1042. It carries the ingress change plus a test that pins both listen addresses, which is exactly the right regression guard (and better than what I had). The egress widening belongs in a separate PR gated on #686/#753, which the TODO comment in #1042 already records. No unique content left in my branch. Appreciate the heads-up on the overlap. |
|
Closing in favor of #1042 — see review reply above. |
atunnel: bind actor ingress/egress listeners dual-stack (
:port) instead of0.0.0.0Fixes: #943
Problem
The atunnel actor ingress (
atunnel-listen-address) and egress(
atunnel-egress-listen-address) listeners defaulted to0.0.0.0:443/0.0.0.0:15001in bothcmd/ateom-gvisor/main.goandcmd/ateom-microvm/main.go.Binding a specific IPv4 wildcard (
0.0.0.0) has two consequences on modernclusters:
ingress listener only exists on the IPv4 loopback/any address, so the router
cannot reach the actor on an IPv6-only pod network.
IPv6 connections, so dual-stack actors lose the IPv6 path.
Since #559 removed the pod-IP:80 DNAT, the mTLS listener is the only actor
ingress path, so this is the sole ingress surface for actors.
Fix
Use Go's dual-stack wildcard form (
:port) as the default for both listenerflags in both ateom binaries.
net.Listen("tcp", ":443")creates a dual-stacksocket that accepts both IPv6 and IPv4 connections on hosts with IPv6 support,
and falls back to IPv4-only on IPv4-only hosts — the correct default for a
pod-network listener.
Also updated the atecontroller worker-pool deployment apply path, which was
passing the old
0.0.0.0:...values as explicit flag overrides (which wouldhave silently reverted the new default at runtime):
cmd/atecontroller/internal/controllers/workerpool_apply.gocmd/atecontroller/internal/controllers/workerpool_apply_test.goFiles changed
cmd/ateom-gvisor/main.go—:443/:15001defaultscmd/ateom-microvm/main.go—:443/:15001defaultscmd/atecontroller/internal/controllers/workerpool_apply.go— explicit args updatedcmd/atecontroller/internal/controllers/workerpool_apply_test.go— expected args updatedBehavior / compatibility
--atunnel-listen-address=127.0.0.1:8443and it is honored unchanged.SO_ORIGINAL_DSTlookup path (atunnel: IPv6 support for original destination lookup #686) — that is thedestination-address resolution, not the listen address.
--grpc-listen-addr(that flag is unrelated).Verification
gofmt -lclean on all changed files.go vetclean on the affected packages.go test ./internal/atunnel/...passes.0.0.0.0:443/0.0.0.0:15001references in Go sources.