Book Image

The Complete Kubernetes Guide

By : Jonathan Baier, Gigi Sayfan, Jesse White
Book Image

The Complete Kubernetes Guide

By: Jonathan Baier, Gigi Sayfan, Jesse White

Overview of this book

If you are running a number of containers and want to be able to automate the way they’re managed, it can be helpful to have Kubernetes at your disposal. This Learning Path guides you through core Kubernetes constructs, such as pods, services, replica sets, replication controllers, and labels. You'll get started by learning how to integrate your build pipeline and deployments in a Kubernetes cluster. As you cover more chapters in the Learning Path, you'll get up to speed with orchestrating updates behind the scenes, avoiding downtime on your cluster, and dealing with underlying cloud provider instability in your cluster. With the help of real-world use cases, you'll also explore options for network configuration, and understand how to set up, operate, and troubleshoot various Kubernetes networking plugins. In addition to this, you'll gain insights into custom resource development and utilization in automation and maintenance workflows. By the end of this Learning Path, you'll have the expertise you need to progress from an intermediate to an advanced level of understanding Kubernetes. This Learning Path includes content from the following Packt products: • Getting Started with Kubernetes - Third Edition by Jonathan Baier and Jesse White • Mastering Kubernetes - Second Edition by Gigi Sayfan
Table of Contents (26 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Chapter 13. Running Stateful Applications with Kubernetes

In this chapter, we will look into what it takes to run stateful applications on Kubernetes. Kubernetes takes a lot of work out of our hands by automatically starting and restarting pods across the cluster nodes as needed, based on complex requirements and configurations such as namespaces, limits, and quotas. But when pods run storage-aware software, such as databases and queues, relocating a pod can cause the system to break. First, we'll understand the essence of stateful pods and why they are much more complicated to manage in Kubernetes. We will look at a few ways to manage the complexity, such as shared environment variables and DNS records. In some situations, a redundant in-memory state, a DaemonSet, or persistent storage claims can do the trick. The main solution that Kubernetes promotes for state-aware pods is the StatefulSet (previously called PetSet) resource, which allows us to manage an indexed collection of pods with...