kubectl debug
Create debugging sessions for troubleshooting workloads and nodes kubectl reference
25 options Its page in the kubectl reference
Options
Show its 25 options
--arguments-onlyIf specified, everything after -- will be passed to the new container as Args instead of Command.--attachIf true, wait for the container to start running, and then attach as if 'kubectl attach ...' were called.--container, -cContainer name to use for debug container.--copy-toCreate a copy of the target Pod with this name.--customPath to a JSON or YAML file containing a partial container spec to customize built-in debug profiles.--envEnvironment variables to set in the container.--filename, -fidentifying the resource to debug--help, -hhelp for debug--image-pull-policyThe image pull policy for the container.--imageContainer image to use for debug container.--keep-annotationsIf true, keep the original pod annotations.(This flag only works when used with '--copy-to')--keep-init-containersRun the init containers for the pod.--keep-labelsIf true, keep the original pod labels.(This flag only works when used with '--copy-to')--keep-livenessIf true, keep the original pod liveness probes.(This flag only works when used with '--copy-to')--keep-readinessIf true, keep the original pod readiness probes.(This flag only works when used with '--copy-to')--keep-startupIf true, keep the original startup probes.(This flag only works when used with '--copy-to')--profileOptions are "general", "baseline", "restricted", "netadmin" or "sysadmin".--quiet, -qIf true, suppress informational messages.--replaceWhen used with '--copy-to', delete the original Pod.--same-nodeWhen used with '--copy-to', schedule the copy of target Pod on the same node.--set-imageWhen used with '--copy-to', a list of name=image pairs for changing container images, similar to how 'kubectl set image' works.--share-processesWhen used with '--copy-to', enable process namespace sharing in the copy.--stdin, -iKeep stdin open on the container(s) in the pod, even if nothing is attached.--targetWhen using an ephemeral container, target processes in this container name.--tty, -tAllocate a TTY for the debugging container.