raft: Add gitaly cluster info subcommand for inspecting Raft cluster state
After implementing the GetRaftClusterInfo RPC (#6906 (closed)), we need a convenient CLI tool to access this information without writing custom gRPC clients.
Currently, inspecting Raft cluster state requires either writing custom code or using generic gRPC tools like grpcurl. For operators and developers, this creates friction when debugging cluster issues or performing routine health checks.
We should add a new subcommand to the gitaly CLI:
gitaly cluster info [options]
This would provide human-readable output of cluster topology, similar to how kubectl get nodes works for Kubernetes clusters. The command should:
- Display partition distribution and leadership status
- Show replica health across storages
- Support filtering by partition key (authority name + partition ID)
- Offer clean, tabular output for easy reading
Note: Since Gitaly servers are typically not directly accessible from admin environments, this CLI may need to route requests through the GitLab Rails API, which would then proxy the gRPC calls to the appropriate Gitaly nodes. This follows the same pattern as other Gitaly administrative operations.
Example usage:
Show all cluster information
gitaly cluster info --config config.toml
Show specific partition by key
gitaly cluster info --partition-key storage-1:42 --config config.toml
Filter by authority name
gitaly cluster info --authority storage-1 --config config.toml
This would complement the RPC implementation and provide an essential debugging tool for Gitaly cluster operations.
- Depends on: GetRaftClusterInfo RPC implementation
- Reference: https://gitlab.com/gitlab-org/gitaly/-/tree/master/cmd/gitaly