[UX-54] rpk: deprecate rpk redpanda admin command#30332
Open
r-vasquez wants to merge 5 commits intoredpanda-data:devfrom
Open
[UX-54] rpk: deprecate rpk redpanda admin command#30332r-vasquez wants to merge 5 commits intoredpanda-data:devfrom
rpk redpanda admin command#30332r-vasquez wants to merge 5 commits intoredpanda-data:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR deprecates the rpk redpanda admin command tree by hiding it and turning its leaf commands into deprecated shims that delegate to newly introduced rpk cluster subcommands (brokers, loggers, enhanced info, and per-broker config routing).
Changes:
- Hide and deprecate
rpk redpanda adminand its subtrees; leaf commands delegate torpk clusterequivalents viacobraext.DeprecateCmd. - Add
rpk cluster brokersandrpk cluster loggerscommand groups, and extendrpk cluster infowith broker detail/disk-space and decommissioned-node output. - Add
--node-idrouting support torpk cluster config listand introduce/relocate tests for the moved functionality.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/go/rpk/pkg/cli/redpanda/redpanda.go | Marks admin as deprecated in the redpanda command tree (comment + ordering). |
| src/go/rpk/pkg/cli/redpanda/admin/admin.go | Hides/deprecates the entire rpk redpanda admin subtree with a migration pointer. |
| src/go/rpk/pkg/cli/redpanda/admin/brokers/* | Converts brokers subcommands into deprecated shims and delegates list output to cluster code. |
| src/go/rpk/pkg/cli/redpanda/admin/config/config.go | Hides/deprecates config subtree; routes log-level to new cluster loggers set. |
| src/go/rpk/pkg/cli/redpanda/admin/partitions/partitions.go | Hides/deprecates partitions subtree; leaf delegates to cluster partitions list. |
| src/go/rpk/pkg/cli/cluster/cluster.go | Registers new cluster brokers and cluster loggers command groups. |
| src/go/rpk/pkg/cli/cluster/info.go | Enhances broker output with optional Admin API enrichment + disk space; adds shim helper for old brokers list. |
| src/go/rpk/pkg/cli/cluster/config/list.go | Adds --node-id to route config requests to a specific broker (non-cloud only). |
| src/go/rpk/pkg/cli/cluster/loggers/* | Introduces rpk cluster loggers {list,set} implementation and tests. |
| src/go/rpk/pkg/cli/cluster/brokers/* | Introduces rpk cluster brokers {decommission,decommission-status,recommission} and tests. |
| BUILD files (various) | Rewires Bazel deps and moves/removes old test targets in deprecated areas. |
Move decommission, decommission-status, and recommission from `rpk redpanda admin brokers` to a new `rpk cluster brokers` group. Cluster-level operations belong under `rpk cluster`; the admin tree overlaps conceptually with cluster commands and is being deprecated. The old commands remain functional as thin shims that delegate to the new package, are hidden from help, and print a deprecation notice pointing at the new location.
Add --detailed and --include-decommissioned to `rpk cluster info` so it covers everything the deprecated `rpk redpanda admin brokers list` provides: cores, membership, liveness, version, broker UUID, per-broker disk space, and decommissioned-by-UUID rows. With parity in place, the old command becomes a true delegating shim: its body is replaced with a thin wrapper that calls the new `cluster.RunBrokerInfo` helper, eliminating the duplicated rendering logic. Admin API failures fall back silently to the basic broker view; the underlying error is logged via zap and surfaces under -v.
Add --node-id to `rpk cluster config list` so the cluster configuration request can be routed to a specific broker instead of any broker. Useful for diagnosing brokers that appear out of sync with the controller. `rpk redpanda admin config print --host` is now hidden and deprecated; it points users at the new flag. Its --host semantics are preserved unchanged.
Move log level management from `rpk redpanda admin config log-level set` into a new `rpk cluster loggers` group with `list` and `set` subcommands. The old `--help-loggers` flag becomes the standalone `list` command. Replace the confusing `--host` flag (which accepted either a hostname or an admin index) with `--node-id`. On `set`, --node-id is now required via cobra; on `list` it is optional and routes to any broker when unset. The legacy `rpk redpanda admin config log-level` parent and its `set` child are hidden and deprecated; the inner set body is now `loggers.NewSetCommand(fs, p)` so the old helpers and tests are gone.
Hide the `rpk redpanda admin` parent and its brokers/config/partitions intermediate parents so the tree no longer surfaces in help output, and add a top-level deprecation message that points at the new `rpk cluster` locations.
239636a to
505ef9b
Compare
Contributor
Author
|
Collaborator
CI test resultstest results on build#83830
|
c-julin
approved these changes
Apr 30, 2026
Contributor
c-julin
left a comment
There was a problem hiding this comment.
Looks like new cluster info flags which are nice, you can ignore my comments its very minor
| if err != nil { | ||
| log.Errorf("unable to retrieve node UUIDs: %v", err) | ||
| } | ||
| if len(uuids) > 0 { |
Contributor
There was a problem hiding this comment.
minor nit: you can return early here
| for id := range info.byNodeID { | ||
| ids = append(ids, id) | ||
| } | ||
| sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] }) |
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.
Deprecates the rpk redpanda admin command tree by folding its functionality into rpk cluster subcommands. The old commands stay as hidden, deprecated shims that print a migration pointer and delegate to the new code; the whole rpk redpanda admin tree is hidden from help output.
Command migrations:
rpk redpanda admin brokers decommission→rpk cluster brokers decommissionrpk redpanda admin brokers decommission-status→rpk cluster brokers decommission-statusrpk redpanda admin brokers recommission→rpk cluster brokers recommissionrpk redpanda admin brokers list→rpk cluster info -b --detailed --include-decommissionedrpk redpanda admin config print→rpk cluster config list --node-id <ID>rpk redpanda admin config log-level set→rpk cluster loggers setrpk redpanda admin partitions list→rpk cluster partitions list --node-ids <ID>New under
rpk cluster:Examples
Brokers section enriched with Admin API metadata + disk space:
Route the cluster config request to a specific broker:
Set a logger on a specific broker:
Backports Required
Release Notes
Improvements
rpk redpanda adminis deprecated and folded intorpk cluster. Userpk cluster brokersfor decommission/recommission,rpk cluster info -b --detailedto list brokers,rpk cluster config list --node-id <ID>to query a specific broker's view of the cluster config,rpk cluster loggers {list,set}to manage broker log levels, andrpk cluster partitions list --node-ids <ID>to filter partitions by broker.