Skip to content

Instantly share code, notes, and snippets.

@Code0x58
Last active June 1, 2017 20:27
Show Gist options
  • Save Code0x58/6de2a7d019a93319e90d362ba23e1c1a to your computer and use it in GitHub Desktop.
Save Code0x58/6de2a7d019a93319e90d362ba23e1c1a to your computer and use it in GitHub Desktop.
Start kubectl and tunnel in a single line

This is a one liner to connect to a machine and start kubectl proxy, and start a tunnel:

ssh -L 8001:127.0.0.1:8001 -tt $machine "bash -O huponexit -c 'kubectl proxy'"

This will kill kubectl proxy when the SSH process is terminated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment