Skip to content

ateomnet: replace stale named namespaces - #1682

Merged
Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
BenTheElder:ateomnet-stale-netns
Sep 17, 2026
Merged

Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
BenTheElder:ateomnet-stale-netns

Conversation

@BenTheElder

Copy link
Copy Markdown
Collaborator

Remove mounted and unmounted leftovers before namespace creation. Reject invalid names and avoid following symlinks during unmount. Existing namespace handles remain valid.

Tiny pre-req for #1266

Also considering anonymous namespaces or per-activation IDs but eh we can revisit that later.

@BenTheElder

Copy link
Copy Markdown
Collaborator Author

@EItanya Eitan Yarmush (EItanya) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 AI-generated review.

No correctness issues found in 06089cb5. Two optional improvements:

  1. Clarify namespace ownership — net.go:387–393 describes per-actor activation, but both current callers create the namespace at worker startup using the pod UID. Document that lifecycle and the caller’s responsibility to own the name exclusively.

  2. Test retained handles — net_linux_test.go:482–486 closes the original handle before replacement. Keeping it open and verifying it remains usable would cover the PR’s stated guarantee.

All eight package tests passed locally under root. An additional probe confirmed retained handles remain usable, the replacement is distinct, and the caller’s namespace is restored. CI is green; cluster E2E was not rerun locally.

Remove mounted and unmounted leftovers before namespace creation.
Reject invalid names and avoid following symlinks during unmount.
Existing namespace handles remain valid.
@BenTheElder

Copy link
Copy Markdown
Collaborator Author

Good points, updated.

@EItanya
Eitan Yarmush (EItanya) merged commit 0ea56b6 into agent-substrate:main Sep 17, 2026
11 checks passed
Eitan Yarmush (EItanya) pushed a commit to kagent-dev/substrate that referenced this pull request Sep 23, 2026
This is part of agent-substrate#1266 , opening now for discussion.

Stacked on agent-substrate#1682 which
was slightly orthogonal.

This is loosely based on the mini proposal by @howardjohn as discussed
in the community meeting, and feedback from @bowei @EItanya
@LiorLieberman @aojea.


https://docs.google.com/document/d/1TycfQ3iiEpbI3rveMIj0S2PpPuLecb8I5R--yTpt9Ig/edit?resourcekey=0-kJbtEZ-KGzuL5eCjHDvBhg&tab=t.0#heading=h.ga9bfaf55ptk

Roughly:
1. Actor sandboxes each get their own netns. 
- gVisor grabs all interfaces in the netns, and tap currently requires
running something like slipr, so for now we do two netns + a veth when
gVisor.
3. In the netns we directly intercept TCP => atunnel for general
traffic.
4. In the netns we serve a trivial TCP+UDP DNS relay to the pod
resolution.
    - In the future we can insert policy here.
6. We consistently inject a modified resolv.conf instead of
bind-mounting it (gVisor) across both runtimes.
7. Readiness probe dialing happens in the actor netns.

Every actor gets the same fixed guest IP as before, which is only
visible to the actor.
All inbound/outbound traffic comes from atunnel / the DNS relay.
The actor no longer has any direct use of the pod interface, so we can
begin to consider ateom using the network itself.
When we add the rest of multi-actor changes, this greatly simplifies
thing.




Full multi-actor requires further changes, but this diff is already
large (suggest reading commit by commit) and can stand-alone. I'll file
more stacked changes when we've got consensus on this one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants