Code Monkey home page Code Monkey logo

kubectl-janitor's Introduction

kubectl janitor

Build Status Go Report Card LICENSE Releases

kubectl janitor is a kubectl plugin that assists in finding objects in a problematic state in your Kubernetes cluster.

Introduction

Troubleshooting Kubernetes clusters sometimes requires a combination of kubectl commands and other command-line tools such as 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.

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.

Installing

Krew

You can install kubectl janitor using the Krew, the package manager for kubectl plugins.

Once you have Krew installed run the following command:

kubectl krew install janitor

Releases

Check the release page for the full list of pre-built assets.

Install

  1. Download one of the releases that are compatible with your os/arch.
  2. Unzip to get kubectl-janitor
  3. Add it to your PATH or move it to a path already in in PATH (i.e., /usr/local/bin)

Source

go get -u github.com/dastergon/kubectl-janitor/cmd/kubectl-janitor

This command will download and compile kubectl-janitor.

Usage

To get the full list of commands with examples:

kubectl janitor

Features

List Pods that are in a pending state (waiting to be scheduled)

kubectl janitor pods unscheduled

List Pods in an unhealthy state

kubectl janitor pods unhealthy

List Pods that are currently running but not ready for some reason

kubectl janitor pods unready

List the current statuses of the Pods and their respective count

kubectl janitor pods status

List Jobs that have failed to run and have restartPolicy: Never

kubectl janitor jobs failed

List PesistentVolumes that are available for claim

kubectl janitor pvs unclaimed

List PersistentVolumeClaims in a pending state (unbound)

kubectl janitor pvcs pending

You 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.

Cleanup

If you have installed the plugin via the krew command. You can remove the plugin by using the same tool:

kubectl krew uninstall kubectl-janitor

Or, you can "uninstall" this plugin from kubectl by simply removing it from your PATH:

rm /usr/local/bin/kubectl-janitor

Author

Pavlos Ratis @dastergon.

License

Apache 2.0.

kubectl-janitor's People

Contributors

dastergon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kubectl-janitor's Issues

Error running kubespy

Hello!

Installed the kubespy using latest krew: kubectl krew install spy

Issue details

Running :

kubectl spy mypod-10852-599996c776-7rv2d -n test loading spy pod... Error: unknown flag: --generator See 'kubectl run --help' for usage.

Expected

Expected: to get spy info for pod.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.