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)

Decoupling a state


In this topic, we are going to talk about state in containers. This topic will be all theory, but don't worry, we are going to put that theory to test when we write our module. We need to understand the theory behind state versus stateless so that in future, when writing your own Puppet modules to ship Docker, you can make the right design choice about states.

State versus stateless

So, we briefly touched on the topic of state versus stateless in the preceding section, but now, let's get into the nuts and bolts of it. So, let's look at two example applications: one with state and one without. First, we will start with a redis container. Its job is to be the backend store for activemq. The application that uses the queue has logic to check whether the message has been received and expects a response. If that fails, it will retry to send the message. Thus, the queue itself is stateless. We are using redis as a cache. There is no need to give the redis container state, as the...