Repository navigation
Conversation
Add `longhornctl maintenance evict-node` and `evict-disk` commands so node maintenance can be driven from the CLI without the web UI. evict-node cordons the Kubernetes node, disables Longhorn replica scheduling on it and requests eviction of all its replicas. evict-disk does the same for a single disk identified by UUID. Both accept --wait to block until no replicas remain, and evict-node prints the kubectl drain command that finishes the maintenance workflow. Related: longhorn/longhorn#8799 Signed-off-by: Sudeep Reddy <148759887+sudeepr34@users.noreply.github.com>
derekbit
force-pushed
the
feat/maintenance-evict-commands
branch
from
October 12, 2026 01:57
2fc1925 to
189045c
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
longhornctl maintenance evict-nodeandevict-diskcommands so node maintenance can be driven from the CLI without the web UI.evict-node cordons the Kubernetes node, disables Longhorn replica scheduling on it and requests eviction of all its replicas. evict-disk does the same for a single disk identified by UUID. Both accept --wait to block until no replicas remain, and evict-node prints the kubectl drain command that finishes the maintenance workflow.
Related: longhorn/longhorn#8799
Which issue(s) this PR fixes:
Issue longhorn/longhorn#8799
Issue #
What this PR does / why we need it:
Adds
longhornctl maintenance evict-nodeandlonghornctl maintenance evict-diskso node maintenance can be performed from the CLI without the web UI (longhorn/longhorn#8799).evict-node --node-id <id> [--wait]: cordons the Kubernetes node, setsallowScheduling=falseandevictionRequested=trueon the Longhorn node, optionally waits until no replicas remain scheduled on it, then prints thekubectl drain <node> --ignore-daemonsetscommand that finishes the maintenance workflow.evict-disk --node-id <id> --disk-uuid <uuid> [--wait]: setsallowScheduling=falseandevictionRequested=trueon the single disk (resolved from UUID via node status), optionally waiting until the disk holds no replicas.Draining itself stays a
kubectloperation (the drain helper isn't vendored by the CLI); the command prints the exact drain invocation as guidance.Special notes for your reviewer:
status.diskStatus[].scheduledReplica(10s interval, 30m timeout) — there is no explicit "eviction complete" condition on the node.Additional documentation or context
Follows the maintenance workflow in the Longhorn docs (evict before drain). Related discussion: longhorn/longhorn#8593.