From b1d2437cf61a3fef5458985e2301bfe8d81882a6 Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Wed, 9 May 2018 22:54:05 -0400 Subject: [PATCH] command: add docs for node drain -monitor flag --- command/node_drain.go | 5 ++++- website/source/docs/commands/node/drain.html.md.erb | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/command/node_drain.go b/command/node_drain.go index 068ba9aeb..040b16ee1 100644 --- a/command/node_drain.go +++ b/command/node_drain.go @@ -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. @@ -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 diff --git a/website/source/docs/commands/node/drain.html.md.erb b/website/source/docs/commands/node/drain.html.md.erb index d03ca3f0d..1abbc4cfd 100644 --- a/website/source/docs/commands/node/drain.html.md.erb +++ b/website/source/docs/commands/node/drain.html.md.erb @@ -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. @@ -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