- Install devspace to access k8s easily
brew install devspace
- accessable-pod is a pod that you can access over ssh
devspace -n <accessable-pod> enter -- bash -c "echo $(cat ~/.ssh/id_rsa.pub) >> ~/.ssh/authorized_keys"
- copy local key to
cat << EOF >> ~/.ssh/config Host ssh-server Hostname 127.0.0.1 User root Port 2300 ProxyCommand devspace -n sre enter -- nc localhost 2300 IdentitiesOnly yes EOF
- open tunnel, <targer_id>:<target_port> is ip and port that you want to connect
ssh ssh-server -vvv -L8000: <targer_id>:<target_port>
- test connection
telnet localhost 8000
Created
March 13, 2022 04:04
-
-
Save thinhdanggroup/df49fbd53b779b7c6157f508bc13a179 to your computer and use it in GitHub Desktop.
Access another pod over SSH tunnel in K8s
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment