aylei / kubectl-debug

This repository is no longer maintained, please checkout https://github.com/JamesTGrant/kubectl-debug.
Apache License 2.0
2.31k stars 303 forks source link

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

Open melochale opened 3 years ago

melochale commented 3 years ago
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

xianzheTM commented 3 years ago

@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
JamesTGrant commented 3 years ago

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