Skip to content

This tool uses fzf(1)-like fuzzy-finder to do partial or fuzzy search of Kubernetes resources. Instead of specifying full resource names to kubectl commands, you can choose them from an interactive list that you can filter by typing a few characters.

License

Notifications You must be signed in to change notification settings

d-kuro/kubectl-fuzzy

Repository files navigation

kubectl-fuzzy

Fuzzy and partial string search for kubectl

Summary

This tool uses fzf(1)-like fuzzy-finder to do partial or fuzzy search of Kubernetes resources. Instead of specifying full resource names to kubectl commands, you can choose them from an interactive list that you can filter by typing a few characters.

📝 Notes

kubectl >= v1.12.0 is required for plugins to work.

For more information on kuberctl plugins see documentation

Install

Krew

Krew is the plugin manager for kubectl command-line tool.

📝 See the documentation for how to install Krew.

kubectl krew update
kubectl krew install fuzzy

Manually

Please download the binaries from the release page.

or

git clone https://github.com/d-kuro/kubectl-fuzzy.git
cd kubectl-fuzzy
make install

Usage

$ kubectl fuzzy -h
Fuzzy Finder kubectl

Usage:
  kubectl-fuzzy
  kubectl-fuzzy [command]

Available Commands:
  create      Create a resource
  delete      Selecting an object with the fuzzy finder and delete
  describe    Selecting an object with the fuzzy finder and show details
  exec        Selecting a Pod with the fuzzy finder and execute a command in a container
  help        Help about any command
  logs        Selecting a Pod with the fuzzy finder and view the log
  version     Show version

Use "kubectl-fuzzy [command] --help" for more information about a command.

Support Commands

  • kubectl logs
  • kubectl exec
  • kubectl describe
  • kubectl create job --from=cronjob
  • kubectl delete
  • anything else...

📝 See the documentation for support commands.

Preview Mode

You can use the --preview or -P option to display a YAML of the Kubernetes object in a fuzzy finder selector. Or you can use environment variables. KUBE_FUZZY_PREVIEW_ENABLED=true You can switch the display to YAML or JSON with the --preview-format option.

e.g.

kubectl fuzzy describe deployment --preview
or
kubectl fuzzy describe deployment -P

The Kubernetes object displayed in the preview window is simplified by default. Some metadata and statuses have been removed. Use the --raw-preview option to display the unsimplified object.

About

This tool uses fzf(1)-like fuzzy-finder to do partial or fuzzy search of Kubernetes resources. Instead of specifying full resource names to kubectl commands, you can choose them from an interactive list that you can filter by typing a few characters.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published