Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] Exposing Eclipse Che on minishift outside a single host

Hi,

On 01/05/2019 04:07, Robert Kratky wrote:
> On 5/1/19 1:14 AM, Dave Neary wrote:
>> Hi all,
>>
>> I have installed minishift on an Intel NUC for use as a demo host for a
>> conference. The idea is to have 2 laptops connected to the Che instance
>> using a switch and connecting to the OpenShift and Che instance which
>> will be running headless.
>>
>> When I start a minishift VM, tyhe VM IP address is automatically
>> allocated in 192.168.42.252 - an IP address that is routed by
>> libvirt-net from inside the NUC, so I can SSH into the minishift VM
>> fine. However, this IP address doesn't route from any other host.
>>
>> What is the recommended way to bridge from another host to Che running
>> in a minishift VM?
> 
> There are some options listed in the (rather lengthy) "Can I connect to minishift from another pc/laptop?" Minishift issue [1].

Thanks Robert!

> TL;DR: It should be possible by either deploying Minishift to an existing machine [2] (in order to use the libvirt bridged network), or by using SSH tunneling.

If I were using OVS, what I would do is bridge the ethernet device to
the vSwitch, and use VLAN tags to separate host and VM traffic, but that
seems like overkill.

It seemed to be almost set up to work for me out of the box, as long as
I added a route in my laptop to connect to the VM (ip r add
192.168.42.0/24 via 10.19.40.41). Traffic was making it into the NUC (as
per tcpdump), but not the VM. I turned off firewalld to check if there
were some firewall or iptables rules that were dropping packets. After
that, I could see the traffic arriving in the VM and being sent back to
the host, but packets were being dropped at my laptop. It turned out
they were arriving on br1 and leaving on br0 with a source IP on a
different network (192.168.122.x) - which was messing things up.

I got around this by adding a second default route in the VM to send
traffic out on br1, and now I can see the OpenShift console.


> SSH tunneling seems to be the easier (if a bit more restrictive) option. You need to bind Minishift to localhost and then (on the other machine) open SSH tunnels for all required ports. See [3, 4] for details.
> 
> Btw, it's also possible to expose Minishift to the world by using a service such as ngrok [5]. 

I don't think ssh tunneling etc will work because using Che requires
access to a number of ports, and also requires DNS resolution for
various Che services. I seem to recall this tripping me up the first
time I was installing Che.


I'm not married to using minshift for this, I'm happy to use whatever
solution is the easiest to allow 2 remote laptops to connect to the
running Che instance - is there a better way to do this than with
Minishift? If not, I will persist with this approach.

Thanks,
Dave.

> [1] https://github.com/minishift/minishift/issues/1287
> [2] https://docs.openshift.org/latest/minishift/using/run-against-an-existing-machine.html
> [3] https://github.com/minishift/minishift/issues/1287#issuecomment-488146107
> [4] https://blog.chmouel.com/2017/06/09/deploying-minishift-on-a-remote-laptop/
> [5] https://medium.com/@kamesh_sampath/can-world-talk-to-my-minishift-b2dfae12073a
> 

-- 
Dave Neary - Eclipse Che Ecosystem & Community Manager
Open Source and Standards - Red Hat
E: dneary@xxxxxxxxxx / T: @nearyd / Ph: +1-978-799-3338


Back to the top