Fabric8 Vagrant & DNS issue with container

52 views
Skip to first unread message

Charles Moulliard

unread,
Jun 13, 2016, 3:07:22 AM6/13/16
to fab...@googlegroups.com
Hi,

Since last Friday, I have a DNS issue with the docker container Fabric8 ElasticSearch Ipaas. We can ping a host within the container but can't curl/wget a http link

Example 


PING github.com (192.30.252.123): 56 data bytes
64 bytes from 192.30.252.123: icmp_seq=0 ttl=61 time=123.815 ms
64 bytes from 192.30.252.123: icmp_seq=1 ttl=61 time=130.109 ms

The resolv.conf file is defined as the docker container of Fabric8

# more /etc/resolv.conf
search default.svc.cluster.local svc.cluster.local cluster.local
nameserver 172.30.0.1
nameserver 10.0.2.3
options ndots:5

How can I resolve that ?

Regards,
--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Charles Moulliard

unread,
Jun 13, 2016, 3:18:45 AM6/13/16
to fab...@googlegroups.com
Additional info: 

Within the docker ES container, I can ping the DNS Server 10.0.2.3 but not 172.30.0.1

James Strachan

unread,
Jun 13, 2016, 3:24:45 AM6/13/16
to Charles Moulliard, fab...@googlegroups.com
Does DNS work OK on the VM? I've seen this fail before in the past. 

Sometimes this fixes it:

  vagrant reload

Or sometimes I've had to edit docker to add explicit DNS servers. e.g. on the VM do this:

  sudo bash
  vi /etc/resolv.conf


then add:

nameserver 8.8.4.4
nameserver 8.8.8.8

save then run:

  sudo service docker restart




--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
James
-------
Red Hat

Twitter: @jstrachan
Email: james.s...@gmail.com
Blog: https://medium.com/@jstrachan/

open source microservices platform

Charles Moulliard

unread,
Jun 13, 2016, 3:58:11 AM6/13/16
to James Strachan, fab...@googlegroups.com
I think that this problem occurs when we switch from a fixed IP network (LAN) to Wifi network

Question: 

The Virualbox created from Vagrant file contains 3 Networks -->
- 172.17.0.1 : Docker Network
- 10.0.2.0 : DNS Server ?
- 172.28.128.0: OpenShift Network

The network 10.0.2.0 contains a gateway address 10.0.2.2 and DNS Server : 10.0.2.3. Is the DNS Server created by OpenShift (= SkyDNS Server) ? How can we configure it ?

James Strachan

unread,
Jun 13, 2016, 4:00:49 AM6/13/16
to Charles Moulliard, fab...@googlegroups.com
On 13 June 2016 at 08:58, Charles Moulliard <ch0...@gmail.com> wrote:
I think that this problem occurs when we switch from a fixed IP network (LAN) to Wifi network

Yeah - whenever I move networks I always do a 'vagrant reload' to be sure. That usually fixes it

Charles Moulliard

unread,
Jun 14, 2016, 2:39:12 AM6/14/16
to James Strachan, fab...@googlegroups.com
Hi,

Have we changed something with our Vagrant VM box (DNS, Landrush, ...) as since last Friday I must systematically add these nameservers to the /etc/resolv.conf file of the box created using this file (https://github.com/fabric8io/fabric8-installer/blob/master/vagrant/openshift/Vagrantfile) and restart docker/OSE ?

vi /etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8

service docker restart
systemctl start openshift.service

Regards,

Charles

James Strachan

unread,
Jun 14, 2016, 3:00:49 AM6/14/16
to Charles Moulliard, fab...@googlegroups.com
I've created / recreated / reloaded the Vagrant VM for openshift and kubernetes a few times since Saturday and never had to touch resolv.conf once

James Strachan

unread,
Jun 14, 2016, 3:01:06 AM6/14/16
to Charles Moulliard, fab...@googlegroups.com
as we talked about - when changing networks - did you do a 'vagrant reload'?

Charles Moulliard

unread,
Jun 14, 2016, 4:08:19 AM6/14/16
to James Strachan, fab...@googlegroups.com
Since this Monday, I'm working with a new VM Machine and my Mac is connected using an Ethernet Cable (RJ45) to Internet. I haven't switched since yesterday to the WIFI network. The IP address of my MAcOS machine is fix (= NO DHCP Server is used)

Doing multiple vagrant reload doesn't resolve the issue


Here is the config of the Vagrant VM Box


[root@vagrant vagrant]# more /etc/resolv.conf 
; generated by /usr/sbin/dhclient-script
nameserver 10.0.2.3
nameserver 8.8.4.4
nameserver 8.8.8.8
[root@vagrant vagrant]# more /etc/hosts
127.0.0.1   vagrant.f8 vagrant localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

and Landrush

cat /Users/chmoulli/.vagrant.d/data/landrush/log/landrush.log
I, [2016-06-13T19:31:33.370835 #95339]  INFO -- : Starting RubyDNS server (v0.8.5)...
I, [2016-06-13T19:31:33.370989 #95339]  INFO -- : Listening on udp:0.0.0.0:10053
I, [2016-06-13T19:31:33.371241 #95339]  INFO -- : Listening on tcp:0.0.0.0:10053
I, [2016-06-14T08:06:41.841452 #95339]  INFO -- : Resource class: Resolv::DNS::Resource::IN::A
I, [2016-06-14T08:06:41.843289 #95339]  INFO -- : Resource: #<Resolv::DNS::Resource::IN::A:0x000001008a6ed8 @address=#<Resolv::IPv4 172.28.128.4>>

Charles Moulliard

unread,
Jun 14, 2016, 7:09:46 AM6/14/16
to James Strachan, fab...@googlegroups.com
I think that I know the problem

When we create the VirtualBox using Fabric8-Openshift Vagrantfile with the Version 1.1.6 of origin, the DNS Servers defined within the container are correct

sh-4.2$ more /etc/resolv.conf 
search default.svc.cluster.local svc.cluster.local cluster.local localdomain
nameserver 172.28.128.4
nameserver 10.0.2.3

But if now, we use the version 1.3.0.alpha of Origin, then we get a "wrong" DNS IP Address
nameserver 172.30.0.1,
nameserver 10.0.2.3

Question: Can we change the IP Address of the DNS Server to use 172.28.128.4 and not  172.30.0.1?

Charles Moulliard

unread,
Jun 14, 2016, 8:11:25 AM6/14/16
to James Strachan, fab...@googlegroups.com
The workaround for OSE Origin 1.3.1 is perhaps to prepend the ip address of the nameserver 172.28.128.4 as described here :http://developers.redhat.com/blog/2015/11/19/dns-your-openshift-v3-cluster/

Charles Moulliard

unread,
Jun 14, 2016, 10:08:10 AM6/14/16
to fabric8, james.s...@gmail.com

https://github.com/fabric8io/fabric8-installer/pull/90  submitted to resolve the issue. If someone can have a look and validate it, that should be super !

To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io




--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply all
Reply to author
Forward
0 new messages