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

Updating Docker output and curl for sticky sessions #2150

Merged
merged 1 commit into from
Sep 22, 2017

Conversation

jtyr
Copy link
Contributor

@jtyr jtyr commented Sep 20, 2017

Description

This PR is updating the Docker Swarm Mode documentation with examples created with latest version of Docker. It also updates the section describing the access via sticky session by using curl command only instead of requiring to amend the /etc/hosts file and perform the test via web browser.

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution 👍

@@ -1,20 +1,24 @@
# Docker Swarm (mode) cluster

This section explains how to create a multi-host docker cluster with swarm mode using [docker-machine](https://docs.docker.com/machine) and how to deploy Træfik on it.
This section explains how to create a multi-host docker cluster with swarm mode
Copy link
Contributor

Choose a reason for hiding this comment

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

please don't split line: one sentence on line.

Let's deploy Træfik as a docker service in our cluster.
The only requirement for Træfik to work with swarm mode is that it needs to run on a manager node — we are going to use a
[constraint](https://docs.docker.com/engine/reference/commandline/service_create/#/specify-service-constraints-constraint) for that.
Let's deploy Træfik as a docker service in our cluster. The only requirement for
Copy link
Contributor

Choose a reason for hiding this comment

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

one sentence on line

## Deploy your apps

We can now deploy our app on the cluster, here [whoami](https://github.com/emilevauge/whoami), a simple web server in Go.
We start 2 services, on the `traefik-net` network.
We can now deploy our app on the cluster, here
Copy link
Contributor

Choose a reason for hiding this comment

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

one sentence on line

We'll demonstrate that later.

!!! note
If using `docker stack deploy`, there is [a specific way that the labels must be defined in the docker-compose file](https://github.com/containous/traefik/issues/994#issuecomment-269095109).
If using `docker stack deploy`, there is [a specific way that the labels
Copy link
Contributor

Choose a reason for hiding this comment

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

one sentence on line

Repeat the following command multiple times and note that the Hostname changes each time as Traefik load balances each request against the 5 tasks:
## Access to your `whoami0` through Træfik multiple times.

Repeat the following command multiple times and note that the Hostname changes
Copy link
Contributor

Choose a reason for hiding this comment

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

one sentence on line

Traefik relies on a cookie to maintain stickyness so you'll need to test this with a browser.

First you need to add `whoami1.traefik` to your hosts file:
Because the sticky sessions require cookies to work, we used the
Copy link
Contributor

Choose a reason for hiding this comment

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

one sentence on line

```

Now open your browser and go to http://whoami1.traefik/
If you load the cookies file (`-b cookies.txt`) for the next request, you will
Copy link
Contributor

Choose a reason for hiding this comment

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

one sentence on line


The cluster consists of:

- 3 servers
- 1 manager
- 2 workers
- 1 [overlay](https://docs.docker.com/engine/userguide/networking/dockernetworks/#an-overlay-network) network
(multi-host networking)
- 1 [overlay](https://docs.docker.com/engine/userguide/networking/dockernetworks/#an-overlay-network)
Copy link
Contributor

Choose a reason for hiding this comment

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

please don't split line: one sentence on line.

```

!!! note
As Træfik is published, you can access it from any machine and not only the manager.
As Træfik is published, you can access it from any machine and not only the
Copy link
Contributor

Choose a reason for hiding this comment

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

please don't split line: one sentence on line.

@ldez
Copy link
Contributor

ldez commented Sep 20, 2017

Note: it's the documentation for Docker Swarm mode not for Docker Swarm.

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

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

LGTM 📖 🐳

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

@ldez ldez changed the base branch from master to v1.4 September 22, 2017 14:51
Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

5 participants