Mocking layer 7 routing and TSL termination for local Swarm testing 

The first step in creating our mock layer 7 routing service is to generate a certificate for our test domain (for local testing, just add the at-sea.mydomain.com to your dev machine host file). In the following diagram, we generate the certificates with an interactive Certificate Signing Request (CSR) ( the openssl req command will prompt you for the CSR parameters, and this is where you provide the common name of your domain) using the openssl req command to generate the certificate (.crt) and private key (.key) files that are required by NGINX for termination.

We will use Docker secrets (requires Docker Engine-Community Swarm to be initialized) to safely store the certificate ...

Get Mastering Docker Enterprise now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.