- Notifications
You must be signed in to change notification settings - Fork9
List Kubernetes objects in a problematic state
License
dastergon/kubectl-janitor
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
kubectl janitor is a kubectl plugin that assists in finding objects in a problematic state in your Kubernetes cluster.
Troubleshooting Kubernetes clusters sometimes requires acombination ofkubectl commands and other command-line tools such asjq to do correlations around the issues that the various objects might have. Moreover, sometimes the supported options of the--field-selector flag might belimited.
During troubleshooting scenarios, people need to identify the issues quickly without worrying about remembering all the different command combinations. The primary goal of this plugin is to collect some commonly executed kubectl command patterns to identify objects in a problematic state in the cluster and reduce the cognitive load for people troubleshooting.
You can installkubectl janitor using theKrew, the package manager for kubectl plugins.
Once you have Krewinstalled run the following command:
kubectl krew install janitorCheck therelease page for the full list of pre-built assets.
- Download one of the releases that are compatible with your os/arch.
- Unzip to get
kubectl-janitor - Add it to your
PATHor move it to a path already in inPATH(i.e.,/usr/local/bin)
go get -u github.com/dastergon/kubectl-janitor/cmd/kubectl-janitorThis command will download and compilekubectl-janitor.
To get the full list of commands with examples:
kubectl janitorkubectl janitor pods unscheduledkubectl janitor pods unhealthykubectl janitor pods unreadykubectl janitor pods statuskubectl janitor jobs failedkubectl janitor pvs unclaimedkubectl janitor pvcs pendingYou can use the-A or--all-namespaces flag to search for objects in all namespaces.
You can use the--no-headers flag to avoid showing the column names.
If you have installed the plugin via thekrew command. You can remove the plugin by using the same tool:
kubectl krew uninstall kubectl-janitorOr, you can "uninstall" this plugin from kubectl by simply removing it from your PATH:
rm /usr/local/bin/kubectl-janitorPavlos Ratis@dastergon.
About
List Kubernetes objects in a problematic state
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.