Description
In this course, you will :
- Learn how to manage a cluster of nodes as easily as a single node. To begin, you'll learn how to create a swarm, add nodes, and launch services that describe containers.
- Investigate how to route traffic to and within the cluster, as well as how to ensure containers recover from failures.
- Learn how to deploy multi-application stacks and roll out updates.
- cover how to use integrated health checking and use secrets to protect sensitive information
- By the end of this course, you will have the knowledge to deploy your own swarm.
Syllabus :
1. Why Multiple Container Hosts?
- The Magic of Docker Should Work on Multiple Machines Too
- What Are Some of the Concerns When Moving to Multiple Machines?
- What You Should Already Know
- What if a Single Container Isn't Enough?
- Scaling Capacity by Scaling Containers
- What About Balancing Load Across Containers on Different Nodes?
- What Happens When a Container Fails?
- What Happens When a Node Fails?
- What About Internal Communication?
- User Defined Networks to Connect Containers on a Single Node
- docker-compose Simplifies Complex Containers and Networking
- What About Scaling Internal Application Dependencies?
2. Creating a Swarm and Running a Service
- Preparing a Single Node to Follow Along
- Enabling Experimental Features
- Enabling Swarm Mode by Initializing a New Swarm
- Listing and Inspecting Nodes
- Creating an NGINX Service
- A Service Is a Definition of an Application
- Services Lead to Tasks
- Removing a Service
- Updating a Service to Scale the Number of Containers
- Swarm Managers Ensure the Desired State Is Maintained
- The Scheduling Process
- Creating a Second Service for Our Customer API
- The Swarm Mode Routing Mesh
- Testing Throughput on a Scaled Service
3. Adding Nodes
- Moving to Multiple Nodes
- Destroying the Single Node Swarm
- Creating and Managing VMs with Docker Machine
- Accessing my Lab Setup Vagrantfile
- Launching 3 VMs with vagrant up
- Accessing the Docker Engine Inside the Vagrant VMs
- docker swarm init --advertise-addr
- Joining Worker Nodes to the Swarm
- Creating a Service to Visualize Our Cluster State
- What Happens When a Node Is Shut Down
- Creating and Scaling a Second Service
- The Spread Strategy and Testing Throughput of the Scaled Service
- Inspecting Nodes and Clustering Gotchas
- Listing Tasks per Node
- Promoting a Worker to a Manager and Demoting Too
- Draining a Node to Perform Maintenance
- One Container per Node with Global Services
- Swarm Mode Is Incredibly Easy to Setup
4. Ingress Routing and Publishing Ports
- Routing External Traffic to Cluster Services
- Published Ports Provide External Access to Services
- The Ingress Overlay Network
- Options for Routing External Traffic to Nodes
- Host Publishing Mode Instead of Ingress Mode
- Ingress Publish Mode Routes to a Random Container
- Removing a Published Port on an Existing Service
- Adding a Host Mode Published Port
- Publishing a Random Port
5. Reconciling a Desired State
- Reconciling a Desired State
- Quiz - What Happens When We Add a Node to the Swarm?
- Creating a Pending Service and Inspecting Task Status
- Joining a New Node to Fulfill a Pending Service
- What Happens to a Service When We Lose the Only Compatible Node?
- Cleaning up Nodes That Have Failed
- Remove Vestigial Services
- If Your App Fails Then the Corresponding Task Will Be Shutdown
- Scale a Service to Zero to Stop It Without Removing It
- Desired State Reconciliation Affords SRP
6. Rolling Updates
- How Do We Update an Application?
- Updates Seem to Happen All at Once
- Updates Are Incremental
- Running a Docker Command on Every Node in the Cluster
- Specifying an Image Tag When Creating a Service
- Adding Delay Between Task Updates
- Updating Multiple Tasks Concurrently with --update-parallelism
- Cleaning up Task History When Learning
- Quiz Recap on Update Delay and Parallelism
- Using watch to Visualize Updates in a Terminal
- Slowing Down the Update Process to Visualize Updates
- RollOut Mode and Other Update Settings Are WIP
- Inspecting the UpdateConfig Policy per Service
- Watching the UpdateConfig Policy as It Is Updated
- Inspecting Task Errors
- Rolling Back to the Previous Service Definition
- Configuring Rollback Policies
- Use --force to Test Changes to Update Policies
- Watching UpdateStatus During a Service Update
- Simulating and Monitoring an Update Failure
- Resuming a Paused Update
7. Container to Container Networking
- Internal Container to Container Scenario
- Ingress Network Is Special Purpose for Publishing Ports
- Our New Network Topology
- Creating an Overlay Network
- Inspecting Overlay Networks
- Attaching a New Service to Our Overlay Network
- Adding a Second Service to Our Overlay Network
- Viewing Service Logs
- Adding an Environment Variable to an Existing Service
- docker exec to Check Service Discovery on the Overlay Network
- Spelunking Service Discovery as We Scale Services
- Using Curl to Validate Internal Load Balancing
- Validating External Load Balancing via the Ingress Network
- docker service inspect for Finding the Virtual IPs for a Service
- Use DNS Round Robin Instead of a Virtual IP
- Networks Are Lazily Extended to Worker Nodes
- A Few Last Things
8. Deploying with Stacks
- Enough with All the Flags Already
- Remove All Services
- The New Compose Version 3 Format
- Creating a Compose File for Our Viz Service
- Deploying a Stack with a Compose File
- Updating a Service with a Stack Is as Easy as Creating It
- Removing a Stack
- Creating and Deploying a Multi Service Stack
- Specifying Replicas in Compose File
- Quiz and Key Course Takeaway
- The Trifecta Services - Networks and Volumes
9. Health Checking
- A Running Process Is Not Necessarily Ready for Traffic
- Deploying a Cowsay Stack
- What Happens if We Break a Container?
- Automatic Service Recovery with Health Checks
- Manually Forcing a Corrupted Service to Restart
- Options for Adding Health Checks
- Adding a Health Check to a Stack Compose File
- Configuring Interval and Timeout and Retries
- Deploying Health Checks and Inspecting Container Health
- Monitoring When Testing Health Checks
- Monitoring Service Auto Recovery from Health Check Failure
- Adjust the Health Check Interval When Learning
- Health Checks Prevent Traffic to a Container That Is Starting
- Health Checks Prevent Traffic to Unhealthy Containers
- Health Checking with docker run
- Adding a Health Check to a Dockerfile
- Disable Health Checking
10. Protecting Secrets
- Environment Variables Can Leak Passwords
- Creating a Secret for a MySQL Password
- Granting a Service Access to a Secret
- Troubleshooting a Failing Service
- Accessing Secrets in a Container via the Filesystem
- Using a Secret to Provide a MySQL Root Password
- Steps to Use Secrets
- _FILE Image Secrets Convention
- Removing Secrets
- A Convention for Updating a Secret