{"id":17874783,"url":"https://github.com/dastergon/kubectl-janitor","last_synced_at":"2025-03-21T23:31:33.373Z","repository":{"id":57569688,"uuid":"318863074","full_name":"dastergon/kubectl-janitor","owner":"dastergon","description":"List Kubernetes objects in a problematic state","archived":false,"fork":false,"pushed_at":"2021-08-26T17:41:09.000Z","size":42,"stargazers_count":55,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-20T02:13:09.657Z","etag":null,"topics":["k8s","krew","krew-plugin","kubectl","kubectl-plugin","kubectl-plugins","kubernetes","kubernetes-cluster","kubernetes-troubleshooting"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dastergon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-05T18:41:44.000Z","updated_at":"2024-06-15T17:28:39.000Z","dependencies_parsed_at":"2022-09-26T19:00:45.421Z","dependency_job_id":null,"html_url":"https://github.com/dastergon/kubectl-janitor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fkubectl-janitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fkubectl-janitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fkubectl-janitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fkubectl-janitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dastergon","download_url":"https://codeload.github.com/dastergon/kubectl-janitor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221820503,"owners_count":16886185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["k8s","krew","krew-plugin","kubectl","kubectl-plugin","kubectl-plugins","kubernetes","kubernetes-cluster","kubernetes-troubleshooting"],"created_at":"2024-10-28T11:11:26.281Z","updated_at":"2024-10-28T11:11:26.842Z","avatar_url":"https://github.com/dastergon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kubectl janitor\n\n[![Build Status](https://github.com/dastergon/kubectl-janitor/workflows/ci/badge.svg\n)](https://github.com/dastergon/kubectl-janitor/workflows/ci/)\n[![Go Report Card](https://goreportcard.com/badge/dastergon/kubectl-janitor)](https://goreportcard.com/report/dastergon/kubectl-janitor)\n[![LICENSE](https://img.shields.io/github/license/dastergon/kubectl-janitor.svg)](https://github.com/dastergon/kubectl-janitor/blob/master/LICENSE)\n[![Releases](https://img.shields.io/github/release-pre/dastergon/kubectl-janitor.svg)](https://github.com/dastergon/kubectl-janitor/releases)\n\n`kubectl janitor` is a kubectl plugin that assists in finding objects in a problematic state in your Kubernetes cluster.\n\n## Introduction\nTroubleshooting Kubernetes clusters sometimes requires a [combination](https://learnk8s.io/troubleshooting-deployments) of `kubectl` commands and other command-line tools such as [jq](https://github.com/stedolan/jq) to do correlations around the issues that the various objects might have. Moreover, sometimes the supported options of the `--field-selector` flag might be [limited](https://github.com/kubernetes/kubernetes/issues/49387).\n\nDuring 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.\n\n## Installing\n\n### Krew\n\nYou can install `kubectl janitor` using the [Krew](https://github.com/kubernetes-sigs/krew), the package manager for kubectl plugins.\n\nOnce you have Krew [installed](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) run the following command:\n\n    kubectl krew install janitor\n\n### Releases\n\nCheck the [release](https://github.com/dastergon/kubectl-janitor/releases) page for the full list of pre-built assets.\n\n#### Install\n\n1. Download one of the releases that are compatible with your os/arch.\n2. Unzip to get `kubectl-janitor`\n3. Add it to your `PATH` or move it to a path already in in `PATH` (i.e., `/usr/local/bin`)\n\n### Source\n\n    go get -u github.com/dastergon/kubectl-janitor/cmd/kubectl-janitor\n\nThis command will download and compile `kubectl-janitor`.\n\n## Usage\n\nTo get the full list of commands with examples:\n\n    kubectl janitor\n\n### Features\n\n#### List Pods that are in a pending state (waiting to be scheduled)\n\n    kubectl janitor pods unscheduled\n\n#### List Pods in an unhealthy state\n\n    kubectl janitor pods unhealthy\n\n#### List Pods that are currently running but not ready for some reason\n\n    kubectl janitor pods unready\n\n#### List the current statuses of the Pods and their respective count\n\n    kubectl janitor pods status\n\n#### List Jobs that have failed to run and have restartPolicy: Never\n\n    kubectl janitor jobs failed\n\n#### List PesistentVolumes that are available for claim\n\n    kubectl janitor pvs unclaimed\n\n#### List PersistentVolumeClaims in a pending state (unbound)\n\n    kubectl janitor pvcs pending\n\nYou can use the `-A` or `--all-namespaces` flag to search for objects in all namespaces.\n\nYou can use the `--no-headers` flag to avoid showing the column names.\n\n## Cleanup\nIf you have installed the plugin via the `krew` command. You can remove the plugin by using the same tool:\n\n    kubectl krew uninstall kubectl-janitor\n\nOr, you can \"uninstall\" this plugin from kubectl by simply removing it from your PATH:\n\n    rm /usr/local/bin/kubectl-janitor\n\n## Author\n\nPavlos Ratis [@dastergon](https://twitter.com/dastergon).\n\n## License\n\n[Apache 2.0.](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastergon%2Fkubectl-janitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdastergon%2Fkubectl-janitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastergon%2Fkubectl-janitor/lists"}