Skip to content

Instantly share code, notes, and snippets.

@robert-cronin
Created June 12, 2024 04:48
Show Gist options
  • Save robert-cronin/0a76a112fe444bccd50cb7ac56e8b1b5 to your computer and use it in GitHub Desktop.
Save robert-cronin/0a76a112fe444bccd50cb7ac56e8b1b5 to your computer and use it in GitHub Desktop.
Attach an ephemeral debug container (busybox) to a pod
#!/bin/bash
POD_NAME=$1
POD_NAMESPACE=$2
if [[ -z $POD_NAME || -z $POD_NAMESPACE ]]; then
echo "Usage: $0 POD_NAME POD_NAMESPACE"
exit 1
fi
kubectl debug -n $POD_NAMESPACE -it $POD_NAME --image=busybox --target=$POD_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment