Hands-On With StatefulSets

Let's begin with the practical implementation of StatefulSets.

We'll cover the following

Introduction

Now you’ll learn how to deploy a working StatefulSet. The example is intended to demonstrate the way StatefulSets work and reinforce what you’ve already learned. It’s not intended as a production-grade application configuration.

The examples cited will work on Kubernetes clusters running on GCP and GKE. The course’s GitHub repo contains YAML files for other cloud platforms.

If you’re following along, you’ll deploy the following three objects:

  1. A StorageClass
  2. A headless Service
  3. A StatefulSet

To make things easier to follow, you’ll inspect and deploy each object individually. However, all three objects can be grouped in a single YAML file, separated by three dashes. See the app.yml file below.

Get hands-on with 1200+ tech skills courses.