Open benzht opened 7 years ago
Hmm, which VM engine are you using? I am using parallels and it does some nice things that eases networking (it automatically generates hosts entries, etc.). Please try to see whether you can reach
http://rancher-server:8080 from a container WITHIN the agent. (e.g. run it within busybox). I have the feeling that the host resolution within docker containers doesnt extend to the rancher-server host.
Sorry, I forgot to mention the technical details: macOs 10.12.5, VirtualBox 5.1.22, docker 17.03.1-ce-mac12, docker-machine 0.10.0, docker-compose 1.11.2
I had already noticed that the hosts were not added to the /etc/hosts files as you suggest (and I've added respective text to the readme in my fork). The rancher server was happily answering on rancher-server(.shared):8080 from within the agent (see also original post). But something I notice now is that my additions modifications of /etc/hosts are lost after rebooting the VMs. Perhaps some processes do not see my manual changes? Here /etc/hosts from the agent. The server has the identical two lines attached to the file.
docker@rancher-agent-01:~$ cat /etc/hosts
127.0.0.1 rancher-agent-01 localhost localhost.local
# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.99.101 rancher-server.shared rancher-server
192.168.99.100 rancher-agent-01.shared rancher-agent-01
I dont see any entries for the server in the agent hosts file. Please try and start a busybox container on the agent and see whether it can connect to the rancher server. My guess is that it might not even see it. Parallels does some magic with the resolve.conf file which ensures that the server is visible from containers within the agent machine. My gut feeling is that VirtualBox doesn't do that. benzht notifications@github.com schrieb am So. 28. Mai 2017 um 10:47:
Sorry, I forgot to mention the technical details: macOs 10.12.5, VirtualBox 5.1.22, docker 17.03.1-ce-mac12, docker-machine 0.10.0, docker-compose 1.11.2
I had already noticed that the hosts were not added to the /etc/hosts files as you suggest (and I've added respective text to the readme in my fork). The rancher server was happily answering on rancher-server(.shared):8080 from within the agent (see also original post). But something I notice now is that my additions modifications of /etc/hosts are lost after rebooting the VMs. Perhaps some processes do not see my manual changes? Here /etc/hosts from the agent. The server has the identical two lines attached to the file.
docker@rancher-agent-01:~$ cat /etc/hosts 127.0.0.1 rancher-agent-01 localhost localhost.local
The following lines are desirable for IPv6 capable hosts
(added automatically by netbase upgrade)
::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts 192.168.99.101 rancher-server.shared rancher-server 192.168.99.100 rancher-agent-01.shared rancher-agent-01
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/rburgst/rancherci-presentation/issues/1#issuecomment-304501170, or mute the thread https://github.com/notifications/unsubscribe-auth/AABZux-_WpqY24QJEWMPj1ukpn5KGq7Dks5r-TSpgaJpZM4NnbO5 .
This might also help. https://docs.docker.com/engine/userguide/networking/get-started-overlay/#overlay-networking-with-an-external-key-value-store
Unfortunately I don't have a VirtualBox setup since I don't have good past experiences mixing different VM providers
You are right. The docker containers within the boot2docker VMs do not automatically get the /etc/hosts entries of the boot2docker VM. On top, the repository-gui VM is using ENV_DOCKER_REGISTRY_HOST: "rancher-server"
, which resolves to a 172.xxxx
docker IP address and for reasons so far unknown the registry does not answer on that port.
Networking with boot2docker and VirtualBox seems to be a bit of a headache. So I guess I will first try my luck with 'real' machines in the cloud. Maybe some VirtualBox/docker wizard come across this issue and can help.
You can change the "external rancher address" when adding the new agent in the rancher ui. Add the iP address of your rancher-server host (the one that you added to /etc/hosts) then you won't need to rely on dns or hosts entries). In the end this should only affect the internal url that the agent container uses in order to access the rancher server. Once rancher is up and running it shout take care about networks etc.
Hello Rainer, thanks your great presentation at the Spring I/O 2017 in Barcelona last week and making everything available so fast!
Now I am trying to run your setup following the readme and I am running into some difficulties. Some of them I have already fixed/updated in my fork. If you like, I can open a pull-request later when everything works.
With me, the registry-gui consistently refuses to show the registry content. The progress-bar gets stuck and the browser console in both Chrome and Firefox (on Mac) report JSON parse error and undefined variables (see below). Because this is not really essential to the script, I have just moved on.
Step 5 worked OK and delivered the expected command that I've added to step 6:
Next thing that fails is registering the rancher agent:
When I ssh into the agent and 'curl http://rancher-server.shared:8080/v1' I get a long JSON string as reply - so it is accessible. And here I seem to be stuck.
Can you spot what is going wrong here?
Thanks in advance Hartmut
Crome/Firefox console errors when Browsing registry: