Requirements
- socat
kubectl
with proper~/.kube/config
that can connect to your cluster- Working knowledge of
kubectl
client - OpenSSH client
How does it work?
kubectl
does port forwarding tosshd
port of your pod. I'm usingpm2
process managed to keep my services alive in my workstation container. If you have onlysshd
, easiest to use isdropbear
ProxyCommand
of OpenSSH client usessocat
to redirect two wayfd
-
to forwarded port ofkubectl
- Voila! You are in
But WHY?
Starbucks, school, guest network, there are whole bunch of wifi
zones with firewalls
blocking outgoing access to TCP Port 22
. I remember my school's firewall used to scan packet headers to see whether it's http
to allow
it. If you are in a place that whitelists only HTTP
access to non-blacklisted sites, this will do the magic.
This is an autoamtic way of doing it, so you could possibly SSH, SFTP, even use this as JumpHost
in your .ssh/config
, meaning you could connect to regular port 22
servers like:
kubectl proxy => ProxyCommand socat to your pod => regular ssh to any other server