Skip to content

atunnel: ingress CONNECT support - #993

Open
Keith Mattix II (keithmattix) wants to merge 8 commits into
agent-substrate:mainfrom
keithmattix:atunnel-ingress-connect
Open

atunnel: ingress CONNECT support#993
Keith Mattix II (keithmattix) wants to merge 8 commits into
agent-substrate:mainfrom
keithmattix:atunnel-ingress-connect

Conversation

@keithmattix

@keithmattix Keith Mattix II (keithmattix) commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Finishes up the vision from #715 to have atunnel serve CONNECT on the ingress path. This will give us the option to hit actors on other ports besides 80. I haven't wired up atenet router yet because it's nontrivial; we should do that in a second step so we can have a baseline for performance

Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Comment thread cmd/atecontroller/internal/controllers/workerpool_apply.go
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Comment thread internal/atunnel/egress.go Outdated
Comment thread internal/atunnel/egress.go Outdated
Comment thread internal/atunnel/egress.go Outdated
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
type conflictStore struct {
store.Interface
conflictTriggered atomic.Bool
shouldInject func(worker *ateapipb.Worker) bool

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added to try to reduce some flakiness with OnUpdate being written to/read across tests

@ygao-g

Copy link
Copy Markdown
Collaborator

Heads up: --atunnel-connect-listen-address defaults to 0.0.0.0:444, which adds a third instance of #943. It is a declared containerPort that the router dials for CONNECT, so on an IPv6-only cluster nothing is listening on the worker's v6 PodIP — the same failure as 443. :444 binds all address families and still accepts IPv4.

It also collides textually with #978 and #1042: all three edit the same flag var blocks in cmd/ateom-gvisor/main.go and cmd/ateom-microvm/main.go, and the same arg list in workerpool_apply.go.

@keithmattix

Copy link
Copy Markdown
Collaborator Author

Yuan Gao (@ygao-g) I'm not sure I understand; if 0.0.0.0:443 binds dualstack by default, then an ipv6 cluster should still work with it right? The main difference is that #943 was on the egress path and required IP6T_SO_ORIGINAL_DST. The status quo should work with ipv6 only clusters

@ygao-g

Copy link
Copy Markdown
Collaborator

You're right, and my heads-up was wrong.

net.Listen("tcp", "0.0.0.0:444") doesn't bind IPv4-only. Go treats an unspecified address as a wildcard on a listen, so favoriteAddrFamily picks AF_INET6 with IPV6_V6ONLY=0 and the socket is [::]:444, accepting both families — the router reaching the worker's v6 PodIP on 444 works as written. Your read of #943 is the right one: there the dual-stack bind is the bug rather than the fix, because the accepted v6 connection has no IPv4 SO_ORIGINAL_DST to recover. CONNECT takes its target from the request authority and never needs that lookup.

One thing still applies: #1042 changes atunnel-listen-address to :443 in the same var block in both main.gos, so whichever lands second gets a conflict. I'll take the rebase on my side.

Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants