Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Added support for running on Worker nodes in Swarm Mode #216

Open
wants to merge 6 commits into
base: staging
Choose a base branch
from

Conversation

samattridge
Copy link

There may be a better way of achieving this but I've simply added a SWARM_MASTER_ADDRESS environment variable that, if it exists, will allow the Haproxy to run on worker nodes. This is a workaround for the issue I raised (#215).

@samattridge
Copy link
Author

My initial attempt using 'RUNNING_MODE_OVERRIDE' didn't work.

@tifayuki
Copy link
Contributor

@samattridge
LGTM
can you also please update the readme? :)

@tifayuki tifayuki changed the base branch from master to staging August 10, 2017 23:45
samattridge added 2 commits November 10, 2017 11:01
Fixed table cell position of SWARM_MASTER_ADDRESS.
@samattridge
Copy link
Author

Thanks @tifayuki. I've now updated the readme. Hope it's ok?

@sheerun
Copy link

sheerun commented Dec 11, 2017

@tifayuki Could you merge?

@sheerun
Copy link

sheerun commented Dec 11, 2017

@samattridge Could you explain what you mean by "Use this in conjunction with mounting /var/run/docker.sock to make this work" ? What would be example docker-compose.yml to make this work?

@samattridge
Copy link
Author

@sheerun Ah, this is the issue with leaving too much time before looking back at this! /var/run/docker.sock mount is not required. Sorry about that.

It's not a docker-compose.yml file but this is the command I'm running if this helps?

docker service create --name haproxy --network proxy -e DEFAULT_SSL_CERT="certdetails" --publish mode=host,target=443,published=443 --constraint "node.labels.server == application" -e SWARM_MASTER_ADDRESS="172.20.0.68:2375" --mode global dockercloud-haproxy:latest

This is starting a service called 'haproxy' globally on any servers that have the 'server' label 'application' which, in my environment, are not Swarm masters.

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

Successfully merging this pull request may close these issues.

3 participants