Run privileged ephemeral debug containers.
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.
# 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.
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
Coming soon.