ehazlett / interlock

Docker Event Driven Plugin System
Apache License 2.0
978 stars 130 forks source link

Interlock + shipyard example is not working #53

Closed lorentzg closed 8 years ago

lorentzg commented 9 years ago

Environment: Mac OS with single boot2docker vm running (docker 1.7.1). Scenario:

  1. Use shipyard-deploy to start shipyard: http://shipyard-project.com/docs/quickstart/
  2. Create local engine for boot2docker vm in UI as described: http://shipyard-project.com/docs/quickstart/
  3. Login to shipyard-cli and run interlock as described in https://asciinema.org/a/13318
  4. Run "go-demo" as described https://asciinema.org/a/13318

Result: When accessing http://interlock.host:80/ I get response "503 Service Unavailable. No server is available to handle this request.".

Also tried:

  1. To detroy/run, restart interlock and go-demo.
  2. Noticed that shipyard in http://shipyard-project.com/docs/quickstart/ exposes port 8080, which I considered as conflicting with go-demo (it exposes 8080 too and runs on the same boot2docker host), so reinstalled shipyard manually to use another port. However same result, 503 err.

/haproxy?stats does shows some table without any backends.

When checking haproxy config I get: bash$ docker exec -it sleepy_ritchie cat /proxy.conf

managed by interlock

global maxconn 0 pidfile proxy.pid

defaults mode http retries 3 option redispatch option httplog option dontlognull option http-server-close option forwardfor timeout connect 0 timeout client 0 timeout server 0

frontend http-default bind *:8080 monitor-uri /haproxy?monitor stats enable stats uri /haproxy?stats stats refresh 5s

ehazlett commented 9 years ago

How are you running the demo container? You must pass a hostname and expose at least one port. There is no conflict on port 8080 as that is a container port and will not conflict the the host port unless you try to bind to a host port as well which you don't need to. Interlock will take care of finding the random port.

On Friday, July 31, 2015, Lorentz Green notifications@github.com wrote:

Environment: Mac OS with single boot2docker vm running (docker 1.7.1). Scenario:

  1. Use shipyard-deploy to start shipyard: http://shipyard-project.com/docs/quickstart/
  2. Create local engine for boot2docker vm in UI as described: http://shipyard-project.com/docs/quickstart/
  3. Login to shipyard-cli and run interlock as described in https://asciinema.org/a/13318
  4. Run "go-demo" as described https://asciinema.org/a/13318

Result: When accessing http://:80/ I get response "503 Service Unavailable. No server is available to handle this request.".

Also tried:

  1. To detroy/run, restart interlock and go-demo.
  2. Noticed that shipyard in http://shipyard-project.com/docs/quickstart/ exposes port 8080, which I considered as conflicting with go-demo (it exposes 8080 too and runs on the same boot2docker host), so reinstalled shipyard manually to use another port. However same result, 503 err.

/haproxy?stats does shows some table without any backends.

When checking haproxy config I get: bash$ docker exec -it sleepy_ritchie cat /proxy.conf

managed by interlock

global maxconn 0 pidfile proxy.pid

defaults mode http retries 3 option redispatch option httplog option dontlognull option http-server-close option forwardfor timeout connect 0 timeout client 0 timeout server 0

frontend http-default bind *:8080 monitor-uri /haproxy?monitor stats enable stats uri /haproxy?stats stats refresh 5s

— Reply to this email directly or view it on GitHub https://github.com/ehazlett/interlock/issues/53.

lorentzg commented 9 years ago

Hi, sorry you're right about port 8080 - seems I got confused.

I'm running demo container in similar way like shown in your screencast (only different hostname):

shipyard run --name ehazlett/go-demo --publish --hostname shipyard --domain local

Maybe there is issue with some dependencies outside of shipyard+interlock... However I did install haproxy, swarm, machine, just to be shure. :-)

NOTE: When I add engine I add is through UI with https docker url and certs and keys are provided... your screencast shows that engine url is HTTP (not https)... not sure if it can have any impact.

ehazlett commented 9 years ago

Do you have a local host entry for "local" so you can access the container on http://local ? You need the host entry as interlock uses the host header to route to the container.

On Friday, July 31, 2015, Lorentz Green notifications@github.com wrote:

Hi, sorry you're right about port 8080 - seems I got confused.

I'm running demo container in similar way like shown in your screencast (only different hostname):

shipyard run --name ehazlett/go-demo --publish --hostname shipyard --domain local

Maybe there is issue with some dependencies outside of shipyard+interlock... However I did install haproxy, swarm, machine, just to be shure. :-)

NOTE: When I add engine I add is through UI with https docker url and certs and keys are provided... your screencast shows that engine url is HTTP (not https)... not sure if it can have any impact.

— Reply to this email directly or view it on GitHub https://github.com/ehazlett/interlock/issues/53#issuecomment-126668966.

lorentzg commented 9 years ago

I did update as in screencast /etc/host file with boot2docker vm IP where interlock is running: ...

shipyard.local .... I am able to access shipyard using this url: shipyard.local:
ehazlett commented 9 years ago

It might be an issue with the shipyard run. Could you try a regular docker run?

Example: docker run -d -P --hostname local ehazlett/docker-demo

On Friday, July 31, 2015, Lorentz Green <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I did update as in screencast /etc/host file with boot2docker vm IP where interlock is running: ... shipyard.local ....

— Reply to this email directly or view it on GitHub https://github.com/ehazlett/interlock/issues/53#issuecomment-126669887.

lorentzg commented 9 years ago

Ok, I did try:

docker run -d -P --hostname shipyard.local ehazlett/go-demo

Seems shipyard.local/ still returns 503.

lorentzg commented 9 years ago

I did try to do cleanup of containers, restarted boot2docker, reinstalled shipyard and interlock (maybe I did mess something up), however still no success (currently containers that running are listed are below):

ID Image Name Host State Ports
6754498f102b ehazlett/go-demo clever_davinci b2d running tcp/:0.0.0.0:32778:8080
a394f8d0f2a7 ehazlett/interlock:v1 cocky_banach b2d running tcp/:0.0.0.0:80:8080
3973a058c87d shipyard/shipyard-cli goofy_pasteur b2d running
29fe92b44e90 shipyard/shipyard:latest shipyard b2d running tcp/:0.0.0.0:8080:8080
1310d83d5bf5 shipyard/rethinkdb shipyard-rethinkdb b2d running tcp/:0.0.0.0:32776:28015, tcp/:0.0.0.0:32775:29015, tcp/:0.0.0.0:32777:8080
349492191daf shipyard/rethinkdb shipyard-rethinkdb-data b2d running
ehazlett commented 9 years ago

Can you run ehazlett/interlock:latest instead of v1?

On Fri, Jul 31, 2015 at 8:15 AM, Lorentz Green notifications@github.com wrote:

I did try to do cleanup of containers, restarted boot2docker, reinstalled shipyard and interlock (maybe I did mess something up), however still no success (currently containers that running are listed are below): ID Image Name Host State Ports 6754498f102b ehazlett/go-demo clever_davinci b2d running tcp/:0.0.0.0:32778:8080 a394f8d0f2a7 ehazlett/interlock:v1 cocky_banach b2d running tcp/:0.0.0.0:80:8080 3973a058c87d shipyard/shipyard-cli goofy_pasteur b2d running 29fe92b44e90 shipyard/shipyard:latest shipyard b2d running tcp/:0.0.0.0:8080:8080 1310d83d5bf5 shipyard/rethinkdb shipyard-rethinkdb b2d running tcp/:0.0.0.0:32776:28015, tcp/:0.0.0.0:32775:29015, tcp/:0.0.0.0:32777 :8080 349492191daf shipyard/rethinkdb shipyard-rethinkdb-data b2d running

— Reply to this email directly or view it on GitHub https://github.com/ehazlett/interlock/issues/53#issuecomment-126722364.

lorentzg commented 9 years ago

I tried to modify config that you provided by replacing version to "latest" but after install it shows "v1" anyway:

shipyard add-extension --url https://raw.githubusercontent.com/lorentzg/interlockconf/master/interlock_latest.conf

Can you help me out a bit here - how to get "latest" running?

lorentzg commented 9 years ago

It seems I missed image name.. :-( Will fix and retry.

ehazlett commented 9 years ago

Ah the extension. Unfortunately those are being removed in v3. The current recommended way to set that up would be in docker-compose although I'm still not sure why yours isn't working. Could you paste the output of docker logs interlock?

On Fri, Jul 31, 2015 at 4:58 PM, Lorentz Green notifications@github.com wrote:

I seems I missed image name.. :-(

— Reply to this email directly or view it on GitHub https://github.com/ehazlett/interlock/issues/53#issuecomment-126810679.

lorentzg commented 9 years ago

This is from interlock:v1 docker logs (1. install v1 2. then run go-demo 3. view interlock log in shipyard UI ):

time="2015-07-31T21:22:24Z" level="info" msg="loaded engine: b2d" time="2015-07-31T21:22:24Z" level="info" msg="Interlock running proxy=:8080" time="2015-07-31T21:22:24Z" level="info" msg="reloaded proxy"

lorentzg commented 9 years ago

I understand that v2 of shipyard might be superseded by v3. What would be the suggestion how to setup failover/load balancing for shipyard then? Or even more - I'm even ok to accept alternatives to shipyard itself...

ehazlett commented 9 years ago

I'm using interlock with shipyard v3 using just containers and it works nicely. You do have to make sure you have DNS setup or it won't work as you need the host header in order to route to the container.

janeczku commented 8 years ago

@ehazlett I didn't find any example how to integrate interlock with shipyard 3. Could you outline the necessary steps? What do you mean by "DNS setup"?

alexw23 commented 8 years ago

The problem I am having is that the HostIp is 0.0.0.0 - do I need to override this somehow?

tmrudick commented 8 years ago

Having the same problem where HostIp is set to 0.0.0.0 with Swarm. I am able to use HAPROXY_PROXY_BACKEND_OVERRIDE_ADDRESS to get around this. But, it seems that it shouldn't be required?

ehazlett commented 8 years ago

Make sure you are connecting to swarm and not docker. Swarm will give back an IP where as the docker engine returns 0.0.0.0.

On Fri, Jan 1, 2016 at 1:33 PM, Tom Rudick notifications@github.com wrote:

Having the same problem where HostIp is set to 0.0.0.0 with Swarm. I am able to use HAPROXY_PROXY_BACKEND_OVERRIDE_ADDRESS to get around this. But, it seems that it shouldn't be required?

— Reply to this email directly or view it on GitHub https://github.com/ehazlett/interlock/issues/53#issuecomment-168327762.

tmrudick commented 8 years ago

Thanks! That appears to be the problem. I had to link to the swarm-manager for it to work correctly using: docker run -p 80:80 -d --link=shipyard-swarm-manager:swarm ehazlett/interlock --swarm-url tcp://swarm:3375 --plugin haproxy start

The swarm-manager container does not expose 3375 using the automatic install. Is that expected?

ehazlett commented 8 years ago

Correct. This is because by default there is no TLS setup and that would expose your Docker engine to the public. You can certainly expose it using the manual deploy but I would strongly recommend setting up TLS.

On Fri, Jan 1, 2016 at 2:04 PM, Tom Rudick notifications@github.com wrote:

Thanks! That appears to be the problem. I had to link to the swarm-manager for it to work correctly using: docker run -p 80:80 -d --link=shipyard-swarm-manager:swarm ehazlett/interlock --swarm-url tcp://swarm:3375 --plugin haproxy start

The swarm-manager container does not expose 3375 using the automatic install. Is that expected?

— Reply to this email directly or view it on GitHub https://github.com/ehazlett/interlock/issues/53#issuecomment-168332419.

tmrudick commented 8 years ago

Makes sense! Thanks!