Kubectl Grep Save

Filter Kubernetes resources by matching their names

Project README

Kubectl Grep

GitHub Actions GoDoc Go Report Card GitHub release GitHub go.mod Go version

Filter Kubernetes resources by matching their names

Compatibility

please refer to Kubernetes version policy and CHANGELOG for supported version matrix.

Why we need it?

playing with Kubernetes is my daily job, and I normally search pods by pipe, grep, --label, --field-selector, etc. while hunting abnormal pods, but typing such long commands is quite annoying.

Before change, we usually filter pods by the following commands,

$ kubectl get pods -n star-lab | grep "flash"

With this plugin installed, you can filter pod with kubectl grep easily

$ kubectl grep pods -n star-lab flash

Installation

Installation via krew

$ kubectl krew version # make sure you are running 0.4.4+
$ kubectl krew install grep
$ kubectl krew update
$ kubectl krew upgrade grep

Manual Installation

$ curl -fsSL -O https://github.com/guessi/kubectl-grep/releases/latest/download/kubectl-grep-$(uname -s)-$(uname -m).tar.gz
$ tar zxvf kubectl-grep-$(uname -s)-$(uname -m).tar.gz
$ mv kubectl-grep /usr/local/bin

How to get developer build?

$ go get -u github.com/guessi/kubectl-grep
$ cd ${GOPATH}/src/github.com/guessi/kubectl-grep
$ make all

FAQ

How do I check the tool's version?

  • kubectl grep version

Can I use version X kubectl with version Y kubectl-grep?

  • Sure, no problem

What kind of resource(s) kubectl-grep support?

Reference

License

Apache-2.0

Open Source Agenda is not affiliated with "Kubectl Grep" Project. README Source: guessi/kubectl-grep
Stars
112
Open Issues
0
Last Commit
1 month ago
Repository
License

Open Source Agenda Badge

Open Source Agenda Rating