mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
## Feature Implementation This PR implements the `kubectl ate top workers` command in `kubectl-ate` to display real-time CPU and Memory resource utilization for worker pods. ### Changes Included: - **Command Structure**: Added `top.go` and `top_workers.go` under `cmd/kubectl-ate/internal/cmd/`. - **Supported Flags**: - `-n, --namespace <ns>`: Scope output to a specific Kubernetes namespace. - `-a, --atespace <space>`: Filter worker pods hosting actors in a specific atespace. - `-l, --selector <labels>`: Filter by worker pool labels. - `-o, --output table|json|yaml`: Output format option. - **Metrics Client**: Added `NewMetricsClientset` to connect to K8s `metrics.k8s.io/v1beta1`. - **Data Join & Fallback**: Joined Substrate `ListWorkers` gRPC RPC with K8s `PodMetrics`, gracefully displaying `metrics unavailable` if `metrics-server` is missing/unavailable. - **Printer & Unit Tests**: Implemented table, JSON, and YAML printers and comprehensive unit tests. Closes #515