Some kubectl plugins

Alvaro Saurin
2 min readNov 1, 2020

kubectl can be extended with plugins for having custom sub-commands. By having a binary like kubectl-something in your PATH, so you can run kubectl something --my-flag and kubectl will automatically invoke kubectl-something --my-flag for you.

I have found several kubectl plugins that extend the functionality of this tool, mainly for inspecting or debugging problems in your cluster.

  • krew: a package manager for kubernetes plugins.
  • kubespy: a tool for observing in realtime, showing how resources are created and destroyed.
  • kubectl-dig: a plugin that shows many useful things like connections, open files, threads, sockets, etc…
  • kubectl-capture: it can trigger a capture in the underlying host which is running a pod, so you can run kubectl capture nginx-78f5d695bd-bcbd8 and it is going to start capturing all the system calls that pod does.
  • ksniff: use kubectl to upload a statically compiled tcpdump binary to your pod and redirecting it's output to your local Wireshark for smooth network debugging experience.
  • kubectl-trace: a plugin that allows you to schedule the execution of bpftrace programs in your Kubernetes cluster.
  • ksync: not really a kubectl plugin, but it allows you to syncrhonize a local directory with some directory in a pod, so you can modify your running pods automatically.

--

--

Alvaro Saurin

Senior Software Engineer specialized in delivering experimental projects into real products.