Book Image

Containerization with LXC

By : Konstantin Ivanov
Book Image

Containerization with LXC

By: Konstantin Ivanov

Overview of this book

In recent years, containers have gained wide adoption by businesses running a variety of application loads. This became possible largely due to the advent of kernel namespaces and better resource management with control groups (cgroups). Linux containers (LXC) are a direct implementation of those kernel features that provide operating system level virtualization without the overhead of a hypervisor layer. This book starts by introducing the foundational concepts behind the implementation of LXC, then moves into the practical aspects of installing and configuring LXC containers. Moving on, you will explore container networking, security, and backups. You will also learn how to deploy LXC with technologies like Open Stack and Vagrant. By the end of the book, you will have a solid grasp of how LXC is implemented and how to run production applications in a highly available and scalable way.
Table of Contents (17 chapters)
Containerization with LXC
About the Author
About the Reviewer
Customer Feedback


Using LXC to scale various workloads requires a proxy service such as HAProxy or Nginx, and the actual service running in containers. Network connectivity and segmentation can be achieved using software-defined networks with OVS and GRE tunnels.

In this chapter, we looked at how to run Apache in simple libvirt-based LXC containers that do not require an entire root filesystem, but rather a minimal set of directories with the shared binaries and libraries from the host OS. We also created an Apache cluster behind a load balancer on multiple servers, and demonstrated a simple yet effective way of scaling it by duplicating an LXC container.

In the next chapter, we'll build on what you've learned so far, show how to monitor and back up LXC, and create an autoscaling service with Jenkins and Sensu.