kubectl-debug
Debug cluster resources using interactive debugging containers. tldr-pages
On several platforms
Several platforms
Create an interactive debugging session in a pod and immediately attach to it
kubectl debug pod_name --stdin --tty --image busyboxIdentify--stdinKeep stdin open on the container(s) in the pod, even if nothing is attached. kubectl reference--ttyAllocate a TTY for the debugging container. kubectl reference--imageContainer image to use for debug container. kubectl referenceCreate a debug container with a custom image and name
kubectl debug --image image --container container_name pod_nameIdentify--imageContainer image to use for debug container. kubectl reference--containerContainer name to use for debug container. kubectl referenceCreate an interactive debugging session on a node and immediately attach to it (the container will run in the host namespaces and the host's filesystem will be mounted at /host)
kubectl debug node/node_name --stdin --tty --image busyboxIdentify--stdinKeep stdin open on the container(s) in the pod, even if nothing is attached. kubectl reference--ttyAllocate a TTY for the debugging container. kubectl reference--imageContainer image to use for debug container. kubectl referenceCreate a copy of a pod and add a debug container to it
kubectl debug pod_name --stdin --tty --image image --copy-to pod_copy_nameIdentify--stdinKeep stdin open on the container(s) in the pod, even if nothing is attached. kubectl reference--ttyAllocate a TTY for the debugging container. kubectl reference--imageContainer image to use for debug container. kubectl reference--copy-toCreate a copy of the target Pod with this name. kubectl referenceCreate a copy of a pod and change the command of a specific container
kubectl debug pod_name --stdin --tty --copy-to pod_copy_name --container container_name -- commandIdentify--stdinKeep stdin open on the container(s) in the pod, even if nothing is attached. kubectl reference--ttyAllocate a TTY for the debugging container. kubectl reference--copy-toCreate a copy of the target Pod with this name. kubectl reference--containerContainer name to use for debug container. kubectl referenceCreate a copy of a pod and change the image of a specific container
kubectl debug pod_name --copy-to pod_copy_name --set-image container_name=imageIdentify--copy-toCreate a copy of the target Pod with this name. kubectl reference--set-imageWhen used with '--copy-to', a list of name=image pairs for changing container images, similar to how 'kubectl set image' works. kubectl referenceCreate a copy of a pod and change all container images
kubectl debug pod_name --copy-to pod_copy_name --set-image '*=image'Identify--copy-toCreate a copy of the target Pod with this name. kubectl reference--set-imageWhen used with '--copy-to', a list of name=image pairs for changing container images, similar to how 'kubectl set image' works. kubectl referenceCreate an ephemeral debug container and target a specific container (useful for debugging distroless containers)
kubectl debug pod_name --stdin --tty --image image --target target_container_nameIdentify--stdinKeep stdin open on the container(s) in the pod, even if nothing is attached. kubectl reference--ttyAllocate a TTY for the debugging container. kubectl reference--imageContainer image to use for debug container. kubectl reference--targetWhen using an ephemeral container, target processes in this container name. kubectl reference