Installing Traefik Enterprise Edition on Docker Swarm¶
This page guides you through the installation of TraefikEE (Traefik Enterprise Edition) on Docker Swarm Mode.
Assistance with configuring or setting up a Docker Swarm Mode cluster are not included in this guide. If you need more information about Docker and Swarm, start with the following resources:
- A Docker Swarm cluster:
- Supported versions: 17.06 to 18.09
- At least 1 manager swarm node and 1 worker swarm node
- Bootstrap and control node containers can reach
Accessing the swarm cluster
Just like the Docker CLI,
traefikeectl relies on the same environment variables to set up its connection
with your swarm cluster.
If you are installing on a remote cluster, please make sure to have the
DOCKER_TLS_VERIFY environment variables properly configured before using traefikeectl.
Installation behind a proxy
In order to be able to install TraefikEE behind a proxy, you must define the
variables for each TraefikEE container.
In other words, you need to customize the compose files and add the following snippet into each of them, and perform a customized one-line installation.
services: control-node: # or bootstrap-node or data-node. # [...] environment: HTTP_PROXY: "http://127.0.0.1:3129" HTTPS_PROXY: "http://127.0.0.1:3129"
To install TraefikEE in Docker Swarm Mode, use the
traefikeectl install command line described in the Getting Started page.
By default, the
traefikeectl install command line deploy a cluster with 1 Control Node and 2 Data Nodes.
Adding the option
--swarm allows installing TraefikEE in a Swarm cluster:
traefikeectl install \ --licensekey="XXXXXXXXX" \ --dashboard \ --swarm
Install a cluster with more than one Control Node
To install a TraefikEE cluster with more than one control node, set the option
--controlnodes to the number of control nodes you want.
Only an odd number of control node is accepted.
traefikeectl install \ --licensekey="XXXXXXXXX" \ --dashboard \ --swarm \ --controlnodes=3 \ --datanodes=4
Configure your Ingress
TraefikEE publishes multiple ports to the swarm ingress routing mesh to handle external traffic:
- The HTTP and HTTPS ports (default:
443) one the
- The Control API port, used by
traefikeectlto communicate with
55055), and the dashboard port, where the dashboard is served (default:
8080) on the
All those ports are customizable with
traefikeectl using the following options:
Customizing the ports can be useful if the standard ports are already used or in order to run multiple clusters in parallel.
The previous command installs TraefikEE on your Docker Swarm infrastructure, with the following elements:
All the available installation options are listed on the traefikeectl Reference Page.
Customizing the One-Line Installation¶
Under the hood,
traefikeectl relies on multiple compose files to perform the installation.
To fully customize your setup and leverage the automatic
traefikeectl installation, you can download and tweak
those compose files and make
traefikeectl use your customized version instead of the original ones, using the
Getting the Compose Files¶
# In a subdirectory only containing compose files, here `./compose` curl -sSL \ https://s3.amazonaws.com/traefikee/examples/v1.1.1/swarm/traefikee-swarm-v1.1.1.tar.gz | tar xvz
./bootstrap-node.yml ./control-node.yml ./data-node-global.yml ./data-node-replicated.yml ./single-control-node.yml
Using the option
--swarm.composefilespath, you can tell
traefikeectl to use your customized compose files.
traefikeectl install \ --licensekey="XXXXXXXXX" \ --dashboard \ --swarm.composefilespath="./compose" --swarm
Validate that the TraefikEE cluster is installed correctly:
Name Availability Role Leader ---- ------------ ---- ------ e51a496c9ebc ACTIVE CONTROL NODE YES 6222392b53dc ACTIVE DATA NODE bfd19ebc1afa ACTIVE DATA NODE
Name Availability Role Leader ---- ------------ ---- ------ e51a496c9ebc ACTIVE CONTROL NODE YES d3eeec1dbfd1 ACTIVE CONTROL NODE 77bd1afab740 ACTIVE CONTROL NODE 6222392b53dc ACTIVE DATA NODE bfd19ebc1afa ACTIVE DATA NODE
Your TraefikEE on Docker Swarm cluster is ready.
Backup your Installation¶
Don't forget to setup regular backups using the
traefikeectl backup command.
More information can be found in the backup and restore documentation.
The cluster can be uninstalled with
More information about the uninstall options can be found on the traefikeectl Reference Page.
Now that you have an up running cluster, you can configure your routing.