Skip to content
SHC Docs

shc node drain

drain workloads from a node

Stop scheduling new workloads on and move its deployments elsewhere, one at a time in priority order, each to the node the placement engine picks among those its --where and constraints allow; a stopped deployment moves as it is and stays stopped, and global replicas stop last. Refuses (X400401CLSDRP) before changing state when a deployment is pinned to the node, (X400402CLSDRB) when a move would take the last serving copy of a scaled group and cannot surge, and (X400423CLSDRM) when a deployment on the node has deploy.disruption set to never. A rolling deployment, the default, moves one replica at a time, each ready elsewhere before the next. Repin the deployment, or pass --force to proceed: a never deployment then moves after the rest, and what cannot move stops in place. --plan prints where each stack would go, or what blocks it, and changes nothing: it ignores --yes, --force and --timeout, asks nothing and issues no drain.

shc node drain <node> [flags]
-f, --force proceed past the pin refusal: stop deployments in place when no compatible peer can take them, including deployments pinned to this node
-h, --help help for drain
--plan print where each stack would go, or what blocks it, and change nothing
-T, --timeout int whole-run timeout in seconds, 0 scales it by the number of stacks to move (capped at 60m)
-y, --yes skip confirmation prompt
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-s, --stack string stack name (default: $SHC_STACK)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc node - manage and inspect cluster nodes