example for ssh to kubernetes containers. support audit log for input command
% go run ./bin/main.go --help
Usage of /var/folders/j4/lf3vdk9n1fz_cf5ymm0pw4sh0000gn/T/go-build1832716769/b001/exe/main:
-address string
Address to start SSH Server (default ":2222")
-audit
audit log for input command
-hostkey string
Path to the Host Key (default "$HOME/.ssh/id_rsa")
-in-k8s-cluster
Is running in Kubernetes cluster? load k8s configuration from --kubeconfig if not
-kubeconfig string
Path to the kubernetes configuration (default "$HOME/.kube/config")
% go run ./bin/main.go
2023/08/19 18:54:40 Use Host Key /Users/sope/.ssh/id_rsa
2023/08/19 18:54:40 Initialize k8s client with config file: /Users/sope/.kube/config
2023/08/19 18:54:40 Start SSH Server at :2222
open new terimal
ssh -p 2222 localhost
select pod (default select the first container in pod to exec in)