Configure a Swarm and Scale Services Within Your Cluster

Suggested Pre Requisites

Expertise with Linux and the Linux Command Line is required. Completing the videos in the related section of this course or equivalent experience with Docker and Docker Swarm is needed in order to be successful.

Objectives

The student will be tasked with installing Docker and configuring one management node and one client node, with the Docker service running. They will then need to add the client node to a swarm cluster and work with services across the swarm.

Overview

The student will be tasked with installing Docker and configuring one management node and one client node, with the Docker service running. They will then need to add the client node to a swarm cluster and work with services across the swarm.

Scenarios

Your development team is now working on a new web application service and needs a basic cluster of web servers that they can throw load against in order to test performance.

As a result, you have been asked to provide a basic cluster that encompasses one management node and one client node. You will need to create the manager and join the client to the cluster and confirm they are all registered appropriately.

You have found a basic HTTPD image available on Docker Hub that is fine for this purpose called 'httpd'. Using that image, create a service called 'our_api' that runs across the cluster, making sure to redirect service HTTP port 80 to the underlying swarm port 80, using at least two replicas.

Once you confirm that two replicas are running, increase the replica count to four to be sure your cluster has sufficient capacity to scale. Once confirmed the replicas are running as expected, reduce the replica count back to two and you can turn the environment back over the development team to begin their work.