Skip to content

Conversation

tkanng
Copy link
Contributor

@tkanng tkanng commented May 13, 2019

Hi aylei, this pr might be the solution for #19. I've tested it in my cluster, distoless image prevents user executing shell in the agent container, just like this:

root@iZhp37kmiszbkwzt5oh9csZ:~/k/kube-debug# kubectl get pod
NAME                    READY   STATUS    RESTARTS   AGE
debug-agent-t8sgd       1/1     Running   0          17m
debug-agent-wfvp4       1/1     Running   0          17m
hhhh-5f88b9f6bc-qrwrm   1/1     Running   0          3d
nginx                   1/1     Running   0          3d2h
root@iZhp37kmiszbkwzt5oh9csZ:~/k/kube-debug# kubectl exec -it debug-agent-t8sgd sh
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"sh\": executable file not found in $PATH": unknown
command terminated with exit code 126

@aylei
Copy link
Owner

aylei commented May 13, 2019

Awesome! I'm afraid I don't have time to do a manual test now, but hopefully I will test this PR and give feedbacks in two days.

@tkanng
Copy link
Contributor Author

tkanng commented May 13, 2019

Thanks! :)

@aylei
Copy link
Owner

aylei commented May 14, 2019

Thank you!

@aylei aylei merged commit 412fc4a into aylei:master May 14, 2019
tkanng added a commit to tkanng/kubectl-debug that referenced this pull request May 18, 2019
Build debug-agent image from distroless image (aylei#30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants