/kubectl-pdebug

kubectl plugin to run privileged debug containers

Primary LanguageGoApache License 2.0Apache-2.0

kubectl-pdebug

Build Status Go Report Card LICENSE Releases

Run privileged ephemeral debug containers.

Intro

This is a near clone of kubectl debug focusing on running ephemeral containers alongside pods whilst allowing you to specify additional capabilities or to run as privileged.

Main reasoning for this was to run strace with the SYS_PTRACE capability. This should really be part of kubectl debug but adding to that would take longer than making a plugin.

Example

# kubectl pdebug -n somenamespace pod-sbsv5 --cap-add=SYS_PTRACE -it --image=nicolaka/netshoot --target app -- sh
> strace ...

Run kubectl pdebug --help for the options.

Installation

Manually

Download the binary from the GitHub releases page here. Rename to match kubectl-pdebug and move into $PATH.

curl -o /tmp/kubectl-pdebug -L https://github.com/terrycain/kubectl-pdebug/releases/download/v0.1.1/kubectl-pdebug_0.1.1_linux_amd64
sudo install --group=root --owner=root --mode=0755 /tmp/kubectl-pdebug /usr/local/bin/kubectl-pdebug
rm /tmp/kubectl-pdebug

Via Krew

Coming soon.