LXC/LXD Deep Dive

Course

Intro Video

Photo of Terrence Cox

Terrence Cox

Senior Vice President of Content

A veteran of twenty years in Information Technology in a variety of roles. He has worked in development, security and infrastructure well before they merged into what we now call DevOps. He provides training in Linux, VMWare, DevOps (Ansible, Jenkins, etc) as well as containers and AWS topics. He now leads the Training Architects to produce the courses and content we all know and love!

Length

02:51:23

Difficulty

Intermediate

Course Details

"Container" is the new buzzword, but it doesn’t just mean Docker! This course will dive into LXC (LinuX Containers) and its container manager, LXD.  Students will explore how containers work, how they compare with virtual machines and Docker containers, and how they handle application isolation.  Students will get hands-on by installing and configuring containers and thoughtfully selecting a persistent storage strategy.  The course also covers the intricacies of container networking including inter-container communication, managing container networks, and exposing container ports on the host.  For advanced students, several use cases are explored and implemented using this exciting technology.

Syllabus

Getting Started With LXC/LXD

Introduction to LXC/LXD

Course Introduction

00:00:46

Lesson Description:

In this course, we're going to explore everyone's new favorite topic: Containers! We're going to specifically look at LXC containers and how to control them with LXD, as well as networking, storage, and many use cases to get you started.

About the Author

About the Author

00:01:36

Lesson Description:

Chad Miller is a technophile with a love of teaching high tech. So much so, he's been doing it for over 20 years! From database design to Java to OpenStack, he's taught industry professionals just like you.

LXD vs. Docker

LXD vs. Docker

00:09:06

Lesson Description:

In this lesson, we'll explore what a container really is and how LXD containers differ from their Docker counterparts.

LXC/LXD: Installation and Configuration

Installing LXC/LXD

Installing LXD

00:15:14

Lesson Description:

This lesson will walk students through installing LXD and verifying that everything is functioning as designed.

Exercise: Install LXC/LXD

00:30:00

Troubleshooting LXD Installations

Troubleshooting LXD Installations

00:05:02

Lesson Description:

Learn to troubleshoot and repair common installation problems with LXD.

Launching Your First Container

Launching Your First Container, Part 1

00:09:25

Lesson Description:

In this part of the demo, we'll grab an image, alias it, and make a quick web server while we practice LXC commands.

Launching Your First Container, Part 2

00:09:08

Lesson Description:

In this section at the demo, we take a look at the running web server container, make a snapshot, and demonstrate how to restore a container from a snapshot.

Launching Your First Container, Part 3

00:10:36

Lesson Description:

In this continuation of the previous lesson, we'll go a little deeper into snapshots and how they can save you from typographical (and other) errors, as well as some container image basics.

Exercise: Launching Your First Container

01:00:00

LXC/LXD Check Up

LXC/LXD Images

LXC Images

LXC Images Part 1: Remotes

00:07:32

Lesson Description:

In this section, we'll explore remotes, and create our own.

LXC Images Part 2: Publishing, Exporting, and Examining

00:07:37

Lesson Description:

In this lesson, we'll learn to publish snapshots to images, export images to tarballs, and take a look at the anatomy of an LXC image.

LXC Images Part 3: Creating From Scratch

00:04:58

Lesson Description:

This lesson goes over how to create an image from scratch and import it in to LXD.

Exercise: Using and Creating LXC/LXD Images

00:30:00

LXC Images

LXC/LXD Basics

LXC/LXD Persistent Storage

Setting up ZFS with LXD

File Backing Stores

00:08:35

Lesson Description:

In this lesson, we'll look at where the files are stored in the default "dir" file backing store and also see how to integrate ZFS into LXD 2.0.

Exercise: Using ZFS with LXC

00:30:00

LXC Storage Check-up

LXD/LXD Networking

LXC Networking

LXC Networking Part 1: The Basics

00:04:34

Lesson Description:

In this section, you'll see how two containers can communicate successfully over the local bridge network with the host and with one another.

LXC Networking Part 2: Under the Hood!

00:04:34

Lesson Description:

In this lesson, we'll take a look at how LXC handles IP address management and hostname resolution and discuss packet flow from one container to the next.

Exercise: Experimenting with LXC Networking

00:30:00

Exercise: Exposing Container Ports

00:30:00

Multi-Host LXD Share a Discreet Layer-2 Network

Advanced Container Networking, Part 1

00:09:46

Lesson Description:

In this lesson, we'll discuss the problem, "How do we get containers on multiple physical hosts on the same L2 network?"  We'll also discuss one possible solution and get started implementing it!

Advanced Container Networking, Part 2

00:12:54

Lesson Description:

In this lesson, we'll build the GRE tunnel between the hosts and demonstrate the alternate initialization technique to use our own bridge instead of the built-in LXD bridge.  I'll also show you how easy it is to move containers among hosts once you've got everything configured!

Networking Check Up

Container Use Cases with LXC/LXD

LXC/LXD Challenge Exercises

Introduction to Challenge Exercises

00:00:43

Lesson Description:

Brief instructions for the challenge exercises.  Good luck!

Development Web Cluster

Challenge: Development Web Cluster

00:01:07

Lesson Description:

Deploy a bunch of web server containers, load balance them, and access the load balancer from an external network.

Challenge: Development Web Server – My Solution

00:16:57

Lesson Description:

No peeking until you've given it a shot!  In this video, I walk you through my solution to the challenge exercise.

Exercise: Challenge: Create Proxy to Multiple Web Server Containers

00:30:00

Microservices

Challenge: Deploy a Microservice

00:01:01

Lesson Description:

Here we describe the challenge of deploying a microservice by creating a LEMP or LAMP stack.

Challenge: Deploy a Microservice -- My Solution!

00:09:04

Lesson Description:

You really shouldn't peek at this until you've given it a shot, but here I walk you through my solution to this challenge.

Exercise: Challenge: Deploy a Simple Microservice

00:30:00

Database Replication Testing

Challenge: Database Replication Cluster

00:01:00

Lesson Description:

In this video, we challenge you to create a MariaDB/Galera cluster using Linux Containers!

Challenge: Database Replication Cluster Solution

00:13:36

Lesson Description:

This lesson is a walkthrough of the provided solution.  There are lots of ways to solve this challenge, but here's what I did.

Exercise: Challenge: Set up a Test Galera Cluster

00:30:00

Automatic Backup Testing

Challenge: Automatic Backup Testing

00:01:32

Lesson Description:

The video version of the description of the next challenge exercise: Testing Automatic Backups!

Challenge: Automatic Backup Testing Solution

00:03:46

Lesson Description:

You can find the script we came up with on the exercise solution.  Here is a video walking through our logic and why we made some of the decisions we did.

Exercise: Challenge: Set up Automatic Backup Testing

00:30:00

LXC/LXD Quiz

Where Do I Go From Here?

Conclusion

00:00:58

Lesson Description:

Thanks for taking this course!  Here I talk about some ideas for where to go next!