Skip to content

Commit

Permalink
command: add docs for node drain -monitor flag
Browse files Browse the repository at this point in the history
  • Loading branch information
nickethier committed May 10, 2018
1 parent 6334619 commit 317abec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion command/node_drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Node Drain Options:
-detach
Return immediately instead of entering monitor mode.
-monitor
Enter monitor mode directly without modifying the drain status.
-force
Force remove allocations off the node immediately.
Expand Down Expand Up @@ -136,7 +139,7 @@ func (c *NodeDrainCommand) Run(args []string) int {
}

// Check that enable or disable is not set with monitor
if monitor && enable || monitor && disable {
if monitor && (enable || disable) {
c.Ui.Error("The -monitor flag cannot be used with the '-enable' or '-disable' flags")
c.Ui.Error(commandErrorText(c))
return 1
Expand Down
9 changes: 9 additions & 0 deletions website/source/docs/commands/node/drain.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ operation is desired.
node. Remaining allocations after the deadline are force removed from the
node. Defaults to 1 hour.
* `-detach`: Return immediately instead of entering monitor mode.
* `-monitor`: Enter monitor mode directly without modifying the drain status.
* `-force`: Force remove allocations off the node immediately.
* `-no-deadline`: No deadline allows the allocations to drain off the node
without being force stopped after a certain deadline.
Expand Down Expand Up @@ -114,6 +115,14 @@ $ nomad node drain -disable -keep-ineligible 4d2ba53b
...
```

Enable drain mode and detach from monitoring, then reattach later:

```
$ nomad node drain -enable -detach -self
...
$ nomad node drain -self -monitor
...
```

[eligibility]: /docs/commands/node/eligibility.html
[migrate]: /docs/job-specification/migrate.html

0 comments on commit 317abec

Please sign in to comment.