Book Image

Puppet for Containerization

By : Scott Coulton
Book Image

Puppet for Containerization

By: Scott Coulton

Overview of this book

This book teaches you how to take advantage of the new benefits of containerization systems such as Docker, Kubernetes, Docker Swarm, and Docker UCP, without losing the panoptical power of proper configuration management. You will learn how to integrate your containerized applications and modules with your Puppet workflow. You will also understand how to manage, monitor, and orchestrate hosts to keep deployed containers running seamlessly. With the help of this book, you can efficiently automate and document with containers, as a part of your system. The book will also cover use cases of deploying Puppet within a containerized environment.
Table of Contents (16 chapters)

The code


Now that we have a good understanding of how to make our module stateless, let's go ahead and start coding. We will split the coding into two parts. In the first part we will write the module to install and configure Docker UCP. The final topic will be to run Kubernetes as the frontend.

UCP

The first thing that we need to do is create a new Vagrant repo for this chapter. By now, we should be masters at creating a new Vagrant repo. Once we have created that, we will create a new module called <AUTHOR>-ucpconfig and move it to our modules directory in the root of our Vagrant repo. We will first set up our servers.yml file by adding the code shown in the following screenshot:

As you can see, we are setting up three servers, where ucp-01 will be the master of the cluster and the other two nodes will join the cluster. We will add two more files: config.json and docker_subscription.lic. Here, config.json will contain the authorization key to Docker Hub, and docker_subscription.lic...