LABINTERMEDIATE

Nomad CSI Plugins on GCP

Use the GCE Persistent Disk CSI driver to run a stateful MySQL database on Nomad whose data survives job destroy and rerun.

75 minutes
hashicorp/nomad
Nomad CSI Plugins on GCP - Platform Engineering Hands-On Lab Icon
Share this Lab

Lab Overview

Some Nomad workloads need to persist data that must still be available after the job is stopped and restarted. Nomad supports this through the Container Storage Interface (CSI).

In this lab you use the GCE Persistent Disk CSI driver to attach a real Google Cloud persistent disk to a MySQL database running on Nomad. The GCE PD CSI driver can only attach disks to genuine Google Compute Engine instances, so you use Terraform from a workstation to build the entire Nomad cluster (server and client) as GCE instances, then run the CSI driver and MySQL on it.

You will:

  • Verify the workstation tooling and confirm your injected GCP service account
  • Use Terraform to build a Nomad + Consul cluster of GCE instances in GCP
  • Deploy the gcepd CSI driver and register a Google persistent disk as a volume
  • Deploy MySQL backed by the CSI volume and write data to it
  • Destroy and rerun the MySQL job to prove the data persists on the disk

It is based on the HashiCorp "Stateful Workloads with Container Storage Interface" tutorial, adapted to run on GCP.

What You'll Learn

Explain why the GCE Persistent Disk CSI driver requires real GCE instances

Use Terraform to build a Nomad + Consul cluster of GCE instances and their firewall

Drive a remote Nomad cluster from a workstation with NOMAD_ADDR

Deploy the gcepd CSI controller and node plugins as Nomad jobs

Register a Google persistent disk as a Nomad CSI volume and consume it from a job

Verify that data on a CSI volume survives a Nomad job being destroyed and rerun

Prerequisites

nomad-basics

nomad-simple-cluster

linux-command-line

Technologies Covered

nomadstateful workloadsstoragecsigcpterraform

Choose your plan

Simple, Transparent Pricing

Unlock full access to TeKanAid courses, labs, and bootcamps

Buying for a team? Private corporate training is available for up to 15 learners.View team training
MonthlyQuarterly
Try Premium free for 7 days →

Just exploring? Start free below. Want the full experience? Try Premium free for 7 days (card required, $0 today).

Pro

All courses, with lab scripts to run on your own machine

$59/month

Renews automatically. Cancel anytime.

Final price verified at checkout.

  • Full access to all courses
  • Lab scripts to download and run on your own machine (hosted labs not included)
  • Progress tracking
  • Certificate of completion
  • Community access
  • Self-paced bootcamps
  • Premium puzzle library not included (5 free puzzles available)
  • New content access
Recommended

Premium

Full access, including unlimited hosted labs

$99/month

Renews automatically. Cancel anytime.

Final price verified at checkout.

  • Everything in Pro
  • Unlimited hands-on labs, fully hosted on TeKanAid Academy (nothing to set up)
  • Full access to the puzzle library
  • Lab AI Assistant
  • Priority support

Prefer a single course?

Purchase individual courses for a one-time fee of $79. Full access to course content, quizzes, certificates, and community features, lab access is not included.

Browse Courses

Just exploring? Start free, no account needed

Three free ways to start. All bridge into the paid Premium catalog when you're ready.

Not ready to commit? The crash course is email-only. No academy account required.

Ready to Get Started?

Start this hands-on lab and build real-world Platform Engineering skills

Get Access Now