Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rmohr/kubernetes-custom-exec
Demo on how to write your own `kubectl exec` command with client-go
https://github.com/rmohr/kubernetes-custom-exec
client-go exec kubectl kubernetes websocket
Last synced: 22 days ago
JSON representation
Demo on how to write your own `kubectl exec` command with client-go
- Host: GitHub
- URL: https://github.com/rmohr/kubernetes-custom-exec
- Owner: rmohr
- License: apache-2.0
- Created: 2017-05-15T08:24:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T09:22:18.000Z (over 7 years ago)
- Last Synced: 2024-10-19T18:03:03.654Z (30 days ago)
- Topics: client-go, exec, kubectl, kubernetes, websocket
- Language: Go
- Size: 11.8 MB
- Stars: 13
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Websocket with client-go example
At the moment [kubernetes/client-go](https://github.com/kubernetes/client-go) does not natively support websocket connections. However the SDK provides everything we need to wrap our own websocket connection handler with the necessary Kubernetes security context, to allow us to authenticate to the apiserver.
This demo shows, how to write your own `kubectl exec` in go with the Kubernetes SDK.
## Building
```bash
go get github.com/rmohr/kubernetes-custom-exec
cd $GOPATH/src/github.com/rmohr/kubernetes-custom-exec
go build
```# Running
To execute the command `ls` on pod `virt-api`, in container `virt-api`, type
```bash
./kubernetes-custom-exec -kubeconfig ~/kubeconfig -pod virt-api -namespace default -command ls -container virt-api
anaconda-post.log
bin
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
srv
sys
third_party
tmp
usr
var
virt-api
```