A simple ssh proxy server, from ssh client to k8s container. it is not production ready and not have the full features, hope inspire you do more things.
Description
The workflow like below, it start a ssh server for ssh connection and forward it to k8s.
QuickStart
- install
go get github.com/htlhenry/ssh-to-k8s
or
git clone github.com/htlhenry/ssh-to-k8s $GOPATH/src/github.com/htlhenry/ssh-to-k8s/
- build
cd $GOPATH/src/github.com/htlhenry
go build -o ssh-to-k8s main.go
- run
./ssh-to-k8s -h # show help message
SSH to k8s proxy
Usage:
ssh-to-k8s [flags]
Flags:
-h, --help help for ssh-to-k8s
-c, --kubeConfigPath string k8s config file (default: ~/.kube/config)
-p, --port string listen port (default "2222")
- use it
# Note: there not auth user implement
ssh -o "UserKnownHostsFile /dev/null" 127.0.0.1 -p 2222
# flow the help message, enter:
# <namespace> <pod> <container>
# login to k8s