Categorygithub.com/guessi/kubectl-grep
modulepackage
1.20.1
Repository: https://github.com/guessi/kubectl-grep.git
Documentation: pkg.go.dev

# README

Kubectl Grep

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

Filter Kubernetes resources by matching their names

🤔 Why we need this? what it is trying to resolve?

Playing with Kubernetes in our daily job, we normally search pods by pipe, grep, --label, --field-selector, etc. while hunting abnormal pods, but typing such long commands is quite annoying. With plugin installed, it could be easily be done by kubectl grep.

🔢 Prerequisites

  • An existing Kubernetes cluster.
  • Have kubectl installed.
  • Have krew installed.

🚀 Quick start

# Have krew plugin installed
kubectl krew install grep
# 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 easily
kubectl grep pods -n star-lab flash

:accessibility: FAQ

How do I check the version installed?

  • kubectl grep version

How do I know the version installed is compatible with my cluster version?

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

👷 Install

Recommended way

kubectl krew install grep && kubectl krew update && kubectl krew upgrade grep

Manual Installation

Click to expand!
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

Developer build

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

⚖️ License

Apache-2.0

# Packages

No description provided by the author
No description provided by the author