Thanks for using Nomad!
There isn’t a native way of doing this at this time. This issue is where the feature request is being discussed.
One option available to you today is to define a pre-start lifecycle hook that checks for jobs with some metadata that you define, and have the task sleep until the query returns no jobs with that metadata. Here’s an example from the Nomad Pack Project where we inspect metadata for running jobs.
If this is a blocking issue for you right now, you could always write a little handler yourself that handles this business logic and blocks the task until no other similar jobs are running. You might even be able to pull this off with
jq. The gist of the logic would be
- Get all jobs for node
- Iterate through jobs looking to see if any are the kind you care about
- Implement the init task pattern in your lifecycle hook to block until node is ready
I hope that helps!