Skip to content

Conversation

@omauger
Copy link

@omauger omauger commented Feb 9, 2017

Register services created with docker service command in swarm mode and deregister services if it's deleted. Use same way of containers to configure IP, name and tags.

An improvement will be to register vip service in swarm if we want use internal routing rather than host IP.

I'm a beginner in Golang, don't hesitate to give me corrections instructions.

@marcuslinke
Copy link

marcuslinke commented Sep 8, 2017

Seems this PR is inspired by #476. Right?

}
}

func (b *Bridge) SyncSwarmServices() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the purpose of this function? Why remove already registered services?


if inside {
// VIP is global and singleton, so we can use service name as service id
service.ID = service.Name
Copy link

@marcuslinke marcuslinke Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service.ID has to be in the format HOST_NAME:CONTAINER_NAME:EXPOSED_PORT. Otherwise it will not be cleaned up properly. See https://github.com/alterway/registrator/blob/175e46ca15cc9b9a66ee1e61daa0f49e9b62b090/bridge/bridge.go#L160

// remove register services doesn't exist in swarm services
for _, myservice := range myservices {
for _, tag := range myservice.Tags {
if tag == "vip-outside" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to documentation only consul backend support tags currently, so this will not work with other backends.

@marzlarz
Copy link

marzlarz commented Dec 5, 2017

Any update on this PR ? It seems that swarm events are now available as "docker events" per: moby/moby#23827

This feature would be very useful

@josegonzalez
Copy link
Member

Supersceded by #588. Thanks for the initial PR though!

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

Successfully merging this pull request may close these issues.

4 participants