Rank pods/containers by resource usage-to-limit ratio
Features:
- Memory-bounded streaming (processes k8s data through bounded channels)
- Adaptive pagination with API client/call optimization (chunked data retrieval)
- Circuit breaker with resource pools (prevent cascading failures)
# Analyze pod-level memory usage with custom namespace filtering
kusage pods -A --resource memory --nx '^(observability|kube-system)$' --top 10 --sort pct
# Container analysis with custom sort and limit
kusage containers -n production --resource=memory --sort limit --top 5- Kubernetes Permissions:
pods(get, list) in target namespacespods/metrics(get, list) viametrics.k8s.ioAPI group
- Cluster Components:
- metrics-server must be installed and running
You can install kusage CLI using one of the following ways:
See the release section for kusage checksums and SBOMs.
On Mac or Linux, you can install kusage with Homebrew:
brew tap mchmarny/kusage
brew install kusageNew release will be automatically picked up when you run brew upgrade
If you have Go 1.17 or newer, you can install latest vimp using:
go install github.com/mchmarny/kusage/cmd/kusage@latestYou can also download the latest release version of kusage for your operating system/architecture from here. Put the binary somewhere in your $PATH, and make sure it has that executable bit.
The official
kusagereleases include SBOMs
This is my personal project and it does not represent my employer. While I do my best to ensure that everything works, I take no responsibility for issues caused by this code.