Learning how to exec a pod via WebSocket written in Go.
First clone the repo, and execute Makefile
using make tool:
$ git clone https://github.com/kairen/pod-websocket-exec.git $GOPATH/src/github.com/kairen/pod-websocket-exec
$ cd $GOPATH/src/github.com/kairen/pod-websocket-exec
$ make
To exec the command on pod as below:
$ kubectl run nginx --image nginx --restart=Never
$ ./k8s-ws-exec -p nginx -c nginx -t -i --command sh
# ls
bin dev home lib64 mnt proc run srv tmp var
boot etc lib media opt root sbin sys usr