POD=$(kubectl get pods -n production -l app=api -o jsonpath='{.items[0].metadata.name}') && echo "Debugging pod: $POD" && \ kubectl debug -it $POD -n production --image=busybox:1.36 --target=api -- sh -c \ "wget -qO- http://localhost:8080/health && netstat -tlnp | grep 8080 && ps | grep api"