fabric8io / fabric8

fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
http://fabric8.io/
1.76k stars 504 forks source link

support DNS in the vagrant image #4294

Open jstrachan opened 9 years ago

jstrachan commented 9 years ago

it'd be awesome to enable DNS in the vagrant image so that any service created would be visible properly as a Route. Right now the quickstarts won't work :(

I wonder if this plugin would do the trick with a wildcard DNS entry to map to the IP of the vagrant box? https://github.com/phinze/landrush

davsclaus commented 9 years ago

yeah its the only manual step you need. Though what about that plugin that adds the initial (vagrant plugin install vagrant-hostmanager) etc. I wonder if there is a way to trigger it to insert/remove entries when routes are added / removed?

rhuss commented 9 years ago

Landrush has been enabled in https://github.com/rhuss/fabric8-installer/blob/master/vagrant/openshift-latest/Vagrantfile and on OS X at least it works fine so that *.vagrant.f8 is resolved probably to 172.28.128.4

However, there is still an issue when calling https://fabric8.vagrant.f8 that a 503 "No server is available to handle this request." is returned by the router. I need some help here for debugging.

rhuss commented 9 years ago

oc get routes yields

NAME                    HOST/PORT                    PATH      SERVICE           LABELS
docker-registry-route   docker-registry.vagrant.f8             docker-registry
fabric8                 fabric8.vagrant.f8                     fabric8
christian-posta commented 9 years ago

What apps have you installed? did fabric8:apply not create the routes? or maybe need to run "mvn fabric8:create-routes"?

On Mon, Jun 22, 2015 at 11:20 AM, Roland Huß notifications@github.com wrote:

oc get routes yields

NAME HOST/PORT PATH SERVICE LABELS docker-registry-route docker-registry.vagrant.f8 docker-registry fabric8 fabric8.vagrant.f8 fabric8

— Reply to this email directly or view it on GitHub https://github.com/fabric8io/fabric8/issues/4294#issuecomment-114206819.

Christian Posta twitter: @christianposta http://www.christianposta.com/blog http://fabric8.io

jstrachan commented 9 years ago

@christian-posta the Vagrantfile creates the Route for fabric8

rhuss commented 9 years ago

Yes it does, but it is how the host outside of the Vagrant VM can reach the service via routes. Normally for each route you have to add it to /etc/hosts. With having a DNS provider with a catch-all rule this will be superfluous.

The current setup is only with the fabric8 console and the routes shown above. A 'http://fabric8.vagrant.f8' which should be routed to the console service yields currently the described error.

benmartinpeddey commented 9 years ago

I followed the guide https://github.com/fabric8io/fabric8/blob/master/docs/getStarted/vagrant.md with the following steps on OSX:

This failed on the curl operation to download the openshift-origin tar.gz in the provisionScript of the VagrantFile because github.com wasn't resolved.

I modified the VagrantFile by adding "config.landrush.guest_redirect_dns = false" after "config.landrush.host_ip_address = '172.28.128.4'".

With the modified VagrantFile the "vagrant up" completed without errors.

After "vagrant up" completed I had the following outcomes:

Why did the VagrantFile not work without my modification? Why does vagrant.f8 not resolve? Why do I get 503 Service Unavailable?

benmartinpeddey commented 9 years ago

I have further investigated the landrush DNS issue I have experienced...

when doing "vagrant up" I had the following output: BEGIN EXTRACT [landrush] Starting daemon... Daemon in unknown state! Will clear previous state and continue. [landrush] Daemon status: crashed Dumping daemon crash log: === Daemon Exception Backtrace @ 2015-08-17 17:03:29 +0930 === Errno::EACCES: Permission denied - bind(2) END EXTRACT

I found ISSUE: https://github.com/phinze/landrush/issues/120 which referred to https://github.com/ioquatix/rubydns/issues/55.

I did the following:


export GEM_HOME=~/.vagrant.d/gems gem uninstall celluloid -v 0.16.1 gem install celluloid -v 0.16.0


Now I can ping github.com from the VM without the "config.landrush.guest_redirect_dns = false" modification I had made to the Vagrantfile.

The landrush DNS configuration in fabric8-installer/vagrant/openshift of https://github.com/fabric8io/fabric8-installer.git works fine with celluloid 0.16.0 for both:

Outcomes:

rawlingsj commented 9 years ago

@benmartinpeddey this sounds great!

Would you mind putting a PR together and submitting it to https://github.com/fabric8io/fabric8-installer?

ioquatix commented 9 years ago

My apologies but this is an issue with RubyDNS and Celluloid. Please follow https://github.com/ioquatix/rubydns/issues/55 and I hope to have a fix available soon.

ioquatix commented 9 years ago

Okay, there is a release 1.0.2 which ties RubyDNS to celluloid 0.16.0 which is an interim fix. There will be a release of RubyDNS 2.0 soon which has a better fix and also updates to celluloid 0.17.0 but that still requires a bit of work.

benmartinpeddey commented 9 years ago

Thank you @ioquatix.

@rawlingsj: I have extended the troubleshooting section of the fabric8 getting started vagrant guide regarding the celluloid 0.16.0 issue with landrush 0.18.0. Will commit tomorrow.

rawlingsj commented 9 years ago

great! thanks both @benmartinpeddey and @ioquatix

benmartinpeddey commented 9 years ago

PR for celluloid issue done: https://github.com/fabric8io/fabric8/pull/4638