Published

podgrep: Memorable and useful alias to find Kubernetes Pods

When working with Kubernetes, you’ll often want to find a specific Pod using part of the name or even a regular expression. For this, I keep a handy alias in my bash profile: podgrep. Simple, effective and has a very memorable name.

alias podgrep='kubectl get pods -o wide --all-namespaces | grep '

To find a pod, you then run: podgrep fluent

You can also use regular expressions, like podgrep 'fluent[cd]'

Or list all pods except the ones matching the pattern: podgrep -v fluent