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

alloc-lifecycle: nomad alloc stop #5512

Merged
merged 1 commit into from
Apr 23, 2019
Merged

alloc-lifecycle: nomad alloc stop #5512

merged 1 commit into from
Apr 23, 2019

Conversation

endocrimes
Copy link
Contributor

@endocrimes endocrimes commented Apr 3, 2019

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.

@endocrimes endocrimes marked this pull request as ready for review April 5, 2019 12:43
@endocrimes endocrimes force-pushed the dani/f-alloc-stop branch 2 times, most recently from ff2dfab to 37ebb36 Compare April 11, 2019 12:48
Copy link
Member

@nickethier nickethier left a 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be BadRequest?

Copy link
Contributor Author

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.

command/agent/alloc_endpoint_test.go Outdated Show resolved Hide resolved
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.
@endocrimes endocrimes merged commit 9a4fe5e into master Apr 23, 2019
@endocrimes endocrimes deleted the dani/f-alloc-stop branch April 23, 2019 11:05
endocrimes added a commit that referenced this pull request Apr 23, 2019
@endocrimes endocrimes mentioned this pull request May 9, 2019
@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants