Difficulty: advance
Estimated Time: 10-15 minutes

Following on from the scenario on creating overlay networks, this scenario explains how to create a encrypted overlay network. This allows you to encrypt network traffic between containers.

In this scenario you learned how to create an encrypted overlay network. You also looked into how to use TCP Dump to intercept and monitor network traffic over an overlay network.

Create Encrypted Overlay Network

Step 1 of 4

Step 1 - Initialise Swarm Mode

By default, Docker works as an isolated single-node. All containers are only deployed onto the engine. Swarm Mode turns it into a multi-host cluster-aware engine.

Task: Initialise Swarm Mode

To use the secrets functionality, Docker has to be in "Swarm Mode". This is enabled via docker swarm init

Join Swarm Mode

Execute the command below on the second host to add it as a worker to the cluster.

token=$(ssh -o StrictHostKeyChecking=no [[HOST_IP]] "docker swarm join-token -q worker") && docker swarm join [[HOST_IP]]:2377 --token $token

Terminal Host 2