kubectl-debug icon indicating copy to clipboard operation
kubectl-debug copied to clipboard

Seems the kubectl has build-in debug sub command, it conflicts with it

Open melochale opened this issue 3 years ago • 2 comments

kubectl debug <pod-name>
error: you must specify --image when not using --copy-to.

https://kubernetes.io/docs/tasks/debug-application-cluster/debug-running-pod/#ephemeral-container

melochale avatar Jun 15 '21 03:06 melochale

@aylei I have the same problem. This is my version of kubectl:

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:52:14Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.8-aliyun.1", GitCommit:"2cbb16c", GitTreeState:"", BuildDate:"2021-01-27T02:20:04Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.21) and server (1.18) exceeds the supported minor version skew of +/-1

xianzheTM avatar Jul 15 '21 13:07 xianzheTM

yes, to workaround this call the binary directly, for example: kubectl-debug --namespace NAMESPACE POD_NAME -c TARGET_CONTAINER_NAME

JamesTGrant avatar Dec 01 '21 09:12 JamesTGrant