-
Notifications
You must be signed in to change notification settings - Fork 2k
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
alloc-lifecycle: nomad alloc stop #5512
Conversation
35a2c90
to
440e2d4
Compare
ff2dfab
to
37ebb36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Nice work!
// invoked on the alloc id | ||
tokens := strings.Split(reqSuffix, "/") | ||
if len(tokens) > 2 || len(tokens) < 1 { | ||
return nil, CodedError(404, resourceNotFoundErr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be BadRequest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questionable - Invalid routes usually result in a 404 by convention, BadRequest is usually for things that are badly formed. It's possible to use for invalid routing, but would be weird in Nomad bc we 404 everywhere else.
This adds a `nomad alloc stop` command that can be used to stop and force migrate an allocation to a different node. This is built on top of the AllocUpdateDesiredTransitionRequest and explicitly limits the scope of access to that transition to expose it under the alloc-lifecycle ACL. The API returns the follow up eval that can be used as part of monitoring in the CLI or parsed and used in an external tool.
37ebb36
to
bb142af
Compare
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This command will be used to signal a specific alloc to shut down. When the allocation has been shut down, it will then be rescheduled. By default, this command will then enter an interactive monitoring mode to watch for the replacement allocation and to monitor the restart period. This will then allow an operator to continue inspecting the new job, without polling
nomad status
by hand.It depends on #5500.