minishift with public IP

1,765 views
Skip to first unread message

Kurt T Stam

unread,
Oct 17, 2016, 6:19:24 PM10/17/16
to fab...@googlegroups.com
If you're like me and deploy openshift on remote machine (Centos7) you
may want to keep these instructions to get the console working on your
local machine (OSX). I'm running on centos7 and am using the KVM driver.

After running

minishift start --vm-driver=kvm

1. The VM has 2 networks eth1 (private network for docker-machine) and
eth0 which is the 'public' IP.

For more detail see:
https://github.com/dhiltgen/docker-machine-kvm/blob/master/README.md

Now to expose the VMs eth0 on KVM you will need to create a 'Public Bridge':

Edit /etc/sysconfig/network-scripts/ifcfg-eth0
comment out BOOTPROTO
Add BRIDGE=br0

Create /etc/sysconfig/network-scripts/ifcfg-br0
The content should be:
DEVICE=br0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Bridge

Restart networking

http://www.linux-kvm.org/page/Networking

Now the br0 network should have an IP that is part of your own subnet
(for me it changed from 192.168.42.126 to 192.168.1.2. You can also
verify this using minishift ssh "ip -one -4 addr show dev eth0|cut -f7
-d ' ' "

2. Next you need to go into minishift ssh, and modify the
/var/lib/minishift/openshift.local.config/master/master-config.yml and
update

masterPublicURL: https://192.168.1.2:8443

publicURL: https://192.168.1.2:8443/console/

add to cors:

corsAllowedOrigins:
- .*
- 127.0.0.1
- 192.168.42.126:8443
- 192.168.1.2

masterPublicURL: https://192.168.1.2:8443

assetPublicURL: https://192.168.1.2:8443/console/


3. minishift stop and start

Now you can open the console at https://192.168.1.2:8443 on your laptop
and it will redirect to login you in, and all is happy.

Cheers,

--Kurt

Kurt T Stam

unread,
Oct 17, 2016, 8:13:12 PM10/17/16
to fab...@googlegroups.com
Oh and in /etc/libvirt/qemu/minishift.xml, you now use the br0 bridge.

<interface type='bridge'>
<mac address='52:54:00:b7:c8:25'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
Reply all
Reply to author
Forward
0 new messages