kubeprc (Kubernetes Pod Restart Checker) is a lightweight CLI tool designed to help DevOps and SRE teams quickly detect containers that exceed a specified restart threshold in a Kubernetes namespace.
It automatically connects using in-cluster configuration or falls back to the local kubeconfig file, making it ideal for use in both production and development environments.
- 🔍 Scan Kubernetes namespaces for pod restart counts.
- 📊 Identify containers exceeding a custom threshold.
- 🧩 Works in-cluster and with local kubeconfig.
- ⚡ Fast and easy to integrate into health checks or CI pipelines.
- Download and extract the binary:
tar -xvzf kubeprc-<version>.tar.gz
- Move the binary to a directory in your PATH:
sudo mv ./kubeprc /usr/local/bin/
- Check the version:
kubeprc --version
- *Extract the .tar.gz using tools like 7-Zip.
- Move kubeprc.exe to a directory in your PATH.
- Run:
kubeprc.exe --version
To run the tool and check pods in a namespace:
kubeprc --namespace dev --threshold 5
If any containers have restart counts above 5, they will be listed in the output.
Pods over restart threshold:
Namespace: dev, Pod: api-74df57ff8c-xjtd9, Container: app, RestartCount: 6
Namespace: dev, Pod: db-6c6b6795c7-hs9q4, Container: postgres, RestartCount: 8
| Flag | Shorthand | Default | Description |
|---|---|---|---|
--namespace |
-n |
default |
Namespace to check for pod restarts. |
--threshold |
-t |
3 |
Restart count threshold. Containers exceeding this will be shown. |
--version |
-v |
false |
Prints the current version and exits. |
✅ File Issues or Suggestions ✅ Submit PRs with tested code ✅ Follow clear and concise commenting practices
🌐 LinkedIn- kubeprc
⭐ Star the repo to show support!
☕ Buy Me a Coffee if you find this tool useful.
