Skip to content

Document the ability to publish a port locally on a swarm node#1091

Merged
mdlinville merged 1 commit intodocker:vnext-enginefrom
mdlinville:643_service_publish_port_local
Jan 12, 2017
Merged

Document the ability to publish a port locally on a swarm node#1091
mdlinville merged 1 commit intodocker:vnext-enginefrom
mdlinville:643_service_publish_port_local

Conversation

@mdlinville
Copy link

Proposed changes

Document moby/swarmkit@dfa1fc0

Unreleased project version (optional)

Engine 1.13

Related issues (optional)

Fixes #643

@mdlinville mdlinville added this to the engine/1.13.0 milestone Jan 11, 2017
where that service is running. This feature is available in Docker 1.13 and
higher. This creates less networking overhead by passing the routing mesh, but
you are responsible for routing requests to your service's nodes, and you can
only run one task for a given service on a given swarm node.
Copy link
Contributor

Choose a reason for hiding this comment

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

This restriction is only in place if you specify the published port. If you don't specify it, an ephemeral port will be allocated on the node.

#### Publish a service's ports directly on the swarm node

Using the routing mesh may not be the right choice for your application if you
need to minimize network overhead or your application topology requires that
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe break this down into bullet points.

Copy link
Contributor

@dongluochen dongluochen left a comment

Choose a reason for hiding this comment

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

You mention overhead of routing mesh several times. I'd suggest reduce it. It's more of different scenarios. The major difference is the scenario requires internal load balancing or not. Load balancing always introduces an extra hop.

service running on that node or not. This is less complex but creates some
additional networking overhead.

- [You can publish a service task's port directly on the swarm node](#publish-a-services-ports-directly-on-the-swarm-node)
Copy link
Contributor

Choose a reason for hiding this comment

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

node -> nodes

swarm makes nginx port 80 from the task container accessible at port 8080 on any
node in the swarm. You can direct `curl` at port 8080 of any node in the swarm
to access the web server:
Three tasks will run on up to three nodes. Multiple tasks can run on the same
Copy link
Contributor

Choose a reason for hiding this comment

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

Multiple tasks can run on the same node.

While this is possible, Swarmkit scheduler tries to spread the tasks to different nodes as long as it can. This sentence may be a little misleading.

Copy link
Author

Choose a reason for hiding this comment

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

The intent was to make it clear that you don't know (and shouldn't need to care) where the 3 tasks are run across the 10 nodes. It could be that 8 of the nodes are down for whatever reason. The routing mesh will do the right thing for you. I'll try to make it more clear.

@dongluochen
Copy link
Contributor

LGTM

@mdlinville
Copy link
Author

I think this is good to go, merging it.

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.

3 participants