Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powerstrip not working with swarm cluster #83

Open
Pensu opened this issue Jul 17, 2015 · 2 comments
Open

Powerstrip not working with swarm cluster #83

Pensu opened this issue Jul 17, 2015 · 2 comments

Comments

@Pensu
Copy link

Pensu commented Jul 17, 2015

Hi all,

I have been trying to run powerstrip with a swarm setup. I have one master and one node only. What I want to achieve is:

       docker client

                |

            powerstrip

                |

           swarm deamon

           /          \

       node1          node2

        |               |

      docker          docker

Though I just have the node 1. So, I created the cluster and then ran

$ sudo docker run -d --name powerstrip-slowreq \
           --expose 80 \
           clusterhq/powerstrip-slowreq:v0.0.1
$ sudo docker run -d --name powerstrip \
           -v /var/run/docker.sock:/var/run/docker.sock \
           -v $PWD/powerstrip-demo/adapters.yml:/etc/powerstrip/adapters.yml \
           --link powerstrip-slowreq:slowreq \
           -p 2375:2375 \
           clusterhq/powerstrip:v0.0.1

on swarm manager only. I am running the same powerstrip-slowreq examplt given in the docs. Here are my containers:

vagrant@vagrant-ubuntu-vivid-64:~$ sudo docker ps
CONTAINER ID        IMAGE                                 COMMAND                CREATED             STATUS              PORTS                    NAMES
f1a74df8f0da        clusterhq/powerstrip:v0.0.1           "twistd -noy powerst   43 minutes ago      Up 43 minutes       0.0.0.0:2375->2375/tcp   powerstrip           
01493e977cb1        clusterhq/powerstrip-slowreq:v0.0.1   "python slowreq.py"    About an hour ago   Up About an hour    80/tcp                   powerstrip-slowreq   
a09109652193        swarm                                 "/swarm manage token   About an hour ago   Up About an hour    0.0.0.0:9000->2375/tcp   desperate_rosalind   

It works fine if I am running the docker that is on swarm master node i.e. not the cluster one. In that case I can see the delay of a minute. My question is how do I propagate that to the cluster? According to the example in the docs, I am supposed to use this:

$ time DOCKER_HOST=localhost:2375 docker -H tcp://0.0.0.0:9000 run ubuntu echo hello

But this is not working for obvious reasons as there are two Docker host addresses. Is there any other way to approach this problem? TIA

@lukemarsden
Copy link
Contributor

Hi @Pensu,

Can you describe what you're trying to achieve please?

Running powerstrip in front of swarm has never been a "supported" configuration. I'm curious why you want to do this.

Cheers,
Luke

@Pensu
Copy link
Author

Pensu commented Jul 17, 2015

Hi @lukemarsden, I am just trying to see if it is possible to to extend swarm-api as we are doing with docker-api using powerstrip. Let's say in this specific example, I want to put some delay before the API reaches swarm-daemon, so that I can give user a chance to cancel.

I am just trying to understand why powerstrip can't be used in this configuration? Or how can I extend it to swarm? Or the only way to do it is to use this configuration:

       docker client
                |
           swarm deamon

           /          \

       node1          node2

         |                |

    powerstrip       powerstrip

        |                |

      docker          docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants