hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.82k stars 1.94k forks source link

Namespace Improvements (Meta Issue) #18803

Open mikenomitch opened 11 months ago

mikenomitch commented 11 months ago

Proposal

Improve Namespaces to allow for truly multi-tenant Nomad cluster.

Nomad Namespaces have been used to organizationally separate teams from one another for a long time. In Nomad 1.6 Enterprise, namespaces can be tied to Node Pools. Some additional functionality could be added on top of this to make namespaces even more powerful.

Ideas:

Note - I expect that if we do pursue this, some of these features would be Enterprise-only. We don't know which yet, but I don't want it to be a surprise for anybody following.

Use-cases

This would enable:

Feedback Wanted

If you have other improvements to namespaces to suggest, let us know in a comment!

Alternatively, if you want to chat about this feature, feel free to grab a time on my calendar.

Related Issues

apollo13 commented 11 months ago

Would it be possible to clarify which of those ideas are probably going to be enterprise only?

Thinking out loud (very loud I guess) about:

Delegate more mgmt token permissions to namespace admins

This sounds a bit like you want to implement "nomad admin partitions" (the consul equivalent https://developer.hashicorp.com/consul/docs/enterprise/admin-partitions). Though one could argue that partitions + namespaces could be the same as namespace nesting?!

mikenomitch commented 11 months ago

@apollo13, I'll update once I know on the Enterprise question. If we pursue this, some of this definitely would be Enterprise-only, but I don't know where to draw the line yet. (I'll edit the ticket to clarify this as well)

You're right that there's overlap with admin partitions. I think of node pools + nested namespaces + management delecation as equivalent to a partition. We actually have the open question internally of "do we call this a partition". The upside of that is that Consul users might get the analog, the downside is that its not exactly the same and its one more concept for Nomad users to keep in their head. I lean towards just calling them nested namespaces personally. - If you or anybody else has a preference, let me know!

apollo13 commented 11 months ago

I honestly think a partition would make more sense. Eg think about authentication methods, it seems weird to add permissions for that to a namespace -- are we going to log in to a namespace then? At the end of the day it seems cleaner to me to keep the namespaces as similar as possible in oss and enterprise and then introduce a new concept (partitions) for tenancy. But that may just be me.

the-maldridge commented 11 months ago

I would actually really recommend against calling it a partition. One of my biggest annoyances when managing multiple different Hashicorp tools is that each team gave subtly different definitions to the same identifiers. If you call this a partition, can I assert that all the behaviors of consul admin partitions apply? Probably not. I'd instead try to come up with a designation that Nomad can own and rigidly define.

Also when I think in terms of a cluster scheduler and hear the word "partition" I think "failure domain" which is not really the goal here.


Changing gears and talking about things you can do with namespaces. Its my $0.02 that the ability to nest them probably shouldn't be enterprise, because that will lead to a pattern of "nesting" in the OSS world of just putting delimeters in the name. Once I've got a cluster setup with all my "nesting" done, there's zero chance I'd redo it later on because the risk to my running workloads is just too great.

The min/max priority is an interesting idea though, and to me fits in very well with the enterprise quota system. I could easily see a world in which I would allocate different amounts of each priority to different namespaces so that more preemptable priorities are "cheaper" and teams get to have more of that for free. Maybe all the way down to priority <10 where its just "free" and you can have as much as you want given you understand that you're likely getting kicked off a box pretty regularly.

The use case that pops into my mind when you start going "multi tenant" is bill-back. Even in a 10 person startup I was involved in we "billed" each application back so we could keep track of our AWS costs. The ability to nest the namespaces would have given me a cleaner solution instead of tags on jobs to work out the grouping of each application vertical, assuming this data is exposed in the ever larger firehose of the event stream.

axsuul commented 11 months ago

Can the "Jump to" in the admin UX also support namespaces too? I make heavy use of namespaces with lots of jobs that look like this

foo > app
bar > app
baz > app

So being able to search for all jobs in foo namespace and having it return

foo > app

would be extremely beneficial. Right now searching foo doesn't return anything.