Book description
Get acquainted with the world of LXC
About This Book
Get the most practical and up-to-date resource on LXC and take full advantage of what Linux containers can offer in the day-to-day operations of large-scale applications
Learn how to deploy and administer various workloads such as web applications inside LXC
Save your organization time and money by building robust and secure containers and by speeding the deployment process of your software
Who This Book Is For
This book is for Linux engineers and software developers who are looking to deploy applications in a fast, secure, and scalable way for use in testing and production.
What You Will Learn
Deep dive into the foundations of Linux containers with kernel namespaces and cgroups
Install, configure, and administer Linux containers with LXC and libvirt
Begin writing applications using Python libvirt bindings
Take an in-depth look at container networking
Set up monitoring and security with LXC
Build and deploy a highly available application with LXC in the cloud
In Detail
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.
Style and approach
A practical guide that introduces the core technologies behind Linux containers and provides a deep dive into installation, configuration, and operations of LXC.
Table of contents
-
Containerization with LXC
- Containerization with LXC
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Dedication
- Preface
- 1. Introduction to Linux Containers
- 2. Installing and Running LXC on Linux Systems
-
3. Command-Line Operations Using Native and Libvirt Tools
- Using the LVM backing store
- Using the Btrfs backing store
- Using the ZFS backing store
- Autostarting LXC containers
- LXC container hooks
- Attaching directories from the host OS and exploring the running filesystem of a container
- Freezing a running container
- Limiting container resource usage
-
Building and running LXC containers with libvirt
- Installing libvirt from packages on Debian and CentOS
- Installing libvirt from source
- Defining LXC containers with libvirt
- Starting and connecting to LXC containers with libvirt
- Attaching block devices to running containers with libvirt
- Networking with libvirt LXC
- Generating config from an existing LXC container with libvirt
- Stopping and removing LXC containers with libvirt
- Summary
-
4. LXC Code Integration with Python
-
LXC Python bindings
- Installing the LXC Python bindings and preparing the development environment on Ubuntu and CentOS
- Building our first container with Python
- Gathering container information with Python
- Starting containers, applying changes, and listing configuration options with Python
- Changing container state with Python
- Stopping containers with Python
- Cloning containers with Python
- Destroying containers with Python and cleaning up the virtual environment
- Libvirt Python bindings
- Vagrant and LXC
- Putting it all together – building a simple RESTful API to LXC with Python
- Summary
-
LXC Python bindings
-
5. Networking in LXC with the Linux Bridge and Open vSwitch
-
Software bridging in Linux
- The Linux bridge
- The Linux bridge and the LXC package on Ubuntu
- The Linux bridge and the LXC package on CentOS
- Using dnsmasq service to obtain an IP address in the container
- Statically assigning IP addresses in the LXC container
- Overview of LXC network configuration options
- Manually manipulating the Linux bridge
- Open vSwitch
- Connecting LXC to the host network
- Summary
-
Software bridging in Linux
- 6. Clustering and Horizontal Scaling with LXC
-
7. Monitoring and Backups in a Containerized World
- Backing up and migrating LXC
- Monitoring and alerting on LXC metrics
- Simple autoscaling pattern with LXC, Jenkins, and Sensu
- Summary
-
8. Using LXC with OpenStack
-
Deploying OpenStack with LXC support on Ubuntu
- Preparing the host
- Installing the database service
- Installing the message queue service
- Installing the caching service
- Installing and configuring the identity service
- Installing and configuring the image service
- Installing and configuring the compute service
- Installing and configuring the networking service
- Defining the LXC instance flavor, generating a key pair, and creating security groups
- Creating the networks
- Provisioning LXC container with OpenStack
- Summary
-
Deploying OpenStack with LXC support on Ubuntu
- A. LXC Alternatives to Docker and OpenVZ
Product information
- Title: Containerization with LXC
- Author(s):
- Release date: February 2017
- Publisher(s): Packt Publishing
- ISBN: 9781785888946
You might also like
book
Docker in Practice, Second Edition
Docker in Practice, Second Edition presents over 100 practical techniques, hand-picked to help you get the …
book
Hands-On High Performance with Go
Proven methodologies and concurrency techniques that will help you write faster and better code with Go …
book
Microservices and Containers, First edition
The Complete Guide to Succeeding with Microservices and Docker in Large Software Projects Together, microservices and …
book
Docker Networking Cookbook
60 practical recipes that help you gain expertise with Docker networking and understand the underlying constructs …