Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide namespace / job / group / alloc_id to CNI plugins #23830

Closed
apollo13 opened this issue Aug 15, 2024 · 5 comments · Fixed by #24319
Closed

Provide namespace / job / group / alloc_id to CNI plugins #23830

apollo13 opened this issue Aug 15, 2024 · 5 comments · Fixed by #24319
Labels
hcc/jira help-wanted We encourage community PRs for these issues! stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cni theme/networking type/enhancement

Comments

@apollo13
Copy link
Contributor

apollo13 commented Aug 15, 2024

To make it easier to write CNI plugins it would be great if nomad could provide namespace / job / group / alloc_id via CNI_ARGS to CNI plugins. While it is already possible to use the alloc id (but only when setting the namespace to '*') to query the nomad API and request this information, it would reduce the number of moving parts massively.

The namespace, job and group names are rather important if the CNI provides network policies, which could be nicely written using that information.

Kubernetes already provides the pod name and namespace via CNI_ARGS, so it is not like we are inventing something new here :) Also nomad allows to set similar information for docker containers which makes it easier for 3rd party tooling to do something with it -- why not also make it nicer for CNI. The possibilities are endless, for instance I could use it to update a DNS Server with the alloc ips etc… The changes required in nomad are probably minimal, the extra bytes in the CNI_ARGS will most certainly not hurt and it might make things easier for people trying to do something with CNI.

/cc @tgross

@tgross
Copy link
Member

tgross commented Aug 15, 2024

I asked @apollo13 to open this issue from another discussion we were having. I think this is a great idea but because it represents a new "interface" to ecosystem projects I wanted to get a dialog going with folks whom I know are looking at / have been looking at things like virtual machine networking, CNI, task networking, etc. So I'm going to @-mention a bunch of folks and then leave y'all to chat 😁 cc @rboyer @jrasell @Juanadelacuesta @gulducat

@deverton-godaddy
Copy link
Contributor

More information being available during the CNI ADD call would definitely help simplify scripts that try and wrap CNI implementations to help bridge Nomad information in. For example, #12120 (comment) could be simpler with the task group name and namespace were available as environment variables.

@apollo13
Copy link
Contributor Author

@tgross People seem to be generally in favor (at least not opposed). Any chance of moving that forward?

@tgross
Copy link
Member

tgross commented Oct 29, 2024

Seems reasonable, especially given that we now support CNI args generally so there's a place to wire that up. I'll mark this for roadmapping but it also seems like the sort of thing where a community contribution would be feasible too were one so inclined.

@tgross tgross moved this from Needs Triage to Needs Roadmapping in Nomad - Community Issues Triage Oct 29, 2024
@tgross tgross added stage/accepted Confirmed, and intend to work on. No timeline committment though. help-wanted We encourage community PRs for these issues! labels Oct 29, 2024
@apollo13
Copy link
Contributor Author

You mean like #24319 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hcc/jira help-wanted We encourage community PRs for these issues! stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cni theme/networking type/enhancement
Projects
Development

Successfully merging a pull request may close this issue.

3 participants