kontena / kontena

The developer friendly container and micro services platform. Works on any cloud, easy to setup, simple to use.
https://www.kontena.io/
Apache License 2.0
1.47k stars 127 forks source link

"kontena node ssh" use weave IP when on VPN #1298

Open dsmiley opened 8 years ago

dsmiley commented 8 years ago

kontena node ssh generally doesn't work for me because it uses an IP behind NAT -- it's how my network is set up in my OpenStack based cloud provider. Only one of my nodes in fact have a public IP. When I am VPN'ed into the grid, I wish kontena node ssh chose the weave IP of the form 10.81.0.x. Then it would work.

This is a different and complementary approach to #1297

SpComb commented 8 years ago

Seems like you can use kontena node ssh --internal-ip nodename:

Usage:
    kontena node ssh [OPTIONS] NODE_ID

Options:
    ....
    --internal-ip                 Connect to node's internal IP address (requires VPN connection)

It would be nice if kontena node ssh was smart enough to chose the right address automagically. This would also apply to using the --private-ip for local Vagrant nodes, as their public IP is in the magical VirtualBox 10.0.2.0/24 that the host machine does not have connectivity for.

dsmiley commented 8 years ago

Thanks for the tip @SpComb . Maybe it'd be helpful if kontena node ssh could be instructed to default to internal ip.

jnummelin commented 7 years ago

I guess the biggest trick is to figure out if the VPN to Kontena grid is open or not. :) Could be possible to check if the system where CLI is running has IP address/route to the grid overlay network. (it's nowadays customizable so can't hard code for 10.81.0.X addresses)