hashicorp / hashicorp/nomad

Nomad should create a unique Network Namespace per invocation (not per allocation)

Open
#11,147 4 comments 3 reactions 0 assignees View on GitHub
stage/needs-discussion theme/cni theme/networking type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal
Today Nomad configures CNI by creating a network namespace whose name is "alloc_id"
The problem with this is the task may change the configuration in a destructive or at least "one-way" fashion.
Then when the task gets restarted, it re-uses this allocation ID, and may be stuck failing if the previous invocation "destroyed" the network namespace.

Proposal is that Nomad creates a CNI namespace called "alloc_id"/"invocation_id" instead

### Use-cases
gVisor (runsc) deletes the IPs from the host interface before it starts. Today, CNI + gVisor in nomad cannot work with restarts > 0

I can imagine a much simpler case where a container starts and does "ip delete" or "ip add" or really anything that changes the state in a one-way fashion and pollutes it for the next invocation

### Attempted Solutions
Set restarts to 0

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing Nomad's CNI network-namespace creation and cleanup across task invocations and restarts. Use the gVisor (runsc) restart case as the behavioral reference; done means each invocation receives a distinct namespace while the namespace lifecycle remains correctly cleaned up.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
infrastructure, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.