KUBERNETES(1) kubernetes KUBERNETES(1) (NAME) kubectl-debug - (SYNOPSIS) kubectl debug [OPTIONS] (DESCRIPTION) . 'debug' . . 'debug' . : o (Workload): . o (Workload): (ephemeral container) . o (Node): (host namespaces) . : root debug . (OPTIONS) --arguments-only=false -- (Command) (Args) . --attach=false true '... kubectl attach' . false '-i/--stdin' true . -c, --container="" . --copy-to="" . --custom="" JSON YAML . --env=[] . -f, --filename=[] --image="" . --image-pull-policy="" (image pull policy) . . --keep-annotations=false true (annotations) . ( '--copy-to' ) --keep-init-containers=true (init containers) . true . ( '--copy-to' ) --keep-labels=false true (labels) . ( '--copy-to' ) --keep-liveness=false true (liveness probes) . ( '--copy-to' ) --keep-readiness=false true (readiness probes) . ( '--copy-to' ) --keep-startup=false true (startup probes) . ( '--copy-to' ) --profile="general" "general" "baseline" "restricted" "netadmin" "sysadmin". "general" -q, --quiet=false true . --replace=false '--copy-to' . --same-node=false '--copy-to' . --set-image=[] '--copy-to' name=image 'kubectl set image'. --share-processes=true '--copy-to' (process namespace) . -i, --stdin=false (stdin) () . --target="" (ephemeral container) . -t, --tty=false TTY . (OPTIONS INHERITED FROM PARENT COMMANDS) --as="" (impersonate) . (service account) (namespace) . --as-group=[] . --as-uid="" UID . --as-user-extra=[] . --cache-dir="/home/username/.kube/cache" --certificate-authority="" (certificate authority) --client-certificate="" TLS --client-key="" TLS --cluster="" kubeconfig --context="" kubeconfig --disable-compression=false true --insecure-skip-tls-verify=false true . HTTPS --kubeconfig="" kubeconfig CLI. --kuberc="" kuberc . export KUBECTL_KUBERC=false KUBERC=off . --match-server-version=false -n, --namespace="" (namespace) CLI --password="" (basic authentication) API --profile-output="profile.pprof" --request-timeout="0" . ( 1s 2m 3h). ( ). -s, --server="" Kubernetes API --tls-server-name="" . hostname --token="" Bearer API --user="" kubeconfig --username="" API --version=false --version --version=raw --version=vX.Y.Z... --warnings-as-errors=false (EXAMPLE) # Create an interactive debugging session in pod mypod and immediately attach to it. kubectl debug mypod -it --image=busybox # Create an interactive debugging session for the pod in the file pod.yaml and immediately attach to it. # (requires the EphemeralContainers feature to be enabled in the cluster) kubectl debug -f pod.yaml -it --image=busybox # Create a debug container named debugger using a custom automated debugging image. kubectl debug --image=myproj/debug-tools -c debugger mypod # Create a copy of mypod adding a debug container and attach to it kubectl debug mypod -it --image=busybox --copy-to=my-debugger # Create a copy of mypod changing the command of mycontainer kubectl debug mypod -it --copy-to=my-debugger --container=mycontainer -- sh # Create a copy of mypod changing all container images to busybox kubectl debug mypod --copy-to=my-debugger --set-image=*=busybox # Create a copy of mypod adding a debug container and changing container images kubectl debug mypod -it --copy-to=my-debugger --image=debian --set-image=app=app:debug,sidecar=sidecar:debug # Create 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/mynode -it --image=busybox (SEE ALSO) kubectl(1), (HISTORY) Eric Paris (eparis at redhat dot com) kubernetes ! Eric Paris Jan 2015 KUBERNETES(1)