Skip to content

arush-sal/ksearch

Repository files navigation

🔎 ksearch

Search your Kubernetes resources like you mean it.

CI Release Go Version License

Install with KrewDownload a releaseSee examples

✨ Features

  • 🔍 Search resources by name pattern
  • 📦 Filter results by selected kinds
  • 🧭 Scope to a namespace or search broadly
  • 🧠 Discover supported resources dynamically from the cluster
  • ⚡ Reuse cached output with TTL control
  • 🚀 Install via Krew, GitHub Releases, or source build

🚀 Installation

Krew

After the plugin is accepted into the official kubernetes-sigs/krew-index:

kubectl krew install ksearch

GitHub Releases

Download the latest archive from: https://github.com/arush-sal/ksearch/releases

Build from source

git clone https://github.com/arush-sal/ksearch.git
cd ksearch
make build
./ksearch --help

⚙️ Quick Start

kubectl ksearch
kubectl ksearch -n kube-system
kubectl ksearch -n kube-system -p nginx

🎯 Examples

Search within one namespace:

kubectl ksearch -n default

Find resources related to one workload:

kubectl ksearch -n prod -p nginx

Limit output to selected kinds:

kubectl ksearch -n prod -k deployment,service,configmap,secret

Skip cache for a fresh read:

kubectl ksearch --no-cache

🛠 Flags

Flag Description
-n, --namespace Namespace to search
-p, --pattern Match resource names by substring
-k, --kinds Comma-separated kinds or resources to include
--cache-ttl Cache TTL, defaults to 1m
--no-cache Skip cached output

Environment override:

export KSEARCH_CACHE_TTL=30s

📝 Notes

  • Resource discovery depends on what the current cluster exposes.
  • Cached output is stored locally and reused until the TTL expires.
  • Use --no-cache when you need a fully fresh read.

🤝 Contributing

Contributor-facing documentation lives in CONTRIBUTION.md.

About

ksearch is a kubectl plugin for cluster-wide resource discovery when kubectl get is too narrow. Search by name pattern, limit by kinds, scope by namespace, and reuse cached results for faster repeated lookups. ⚡

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors