This lab is currently in Beta, content may be updated as we refine the material
LABBEGINNER

Register Services, Discover Them & Use the KV Store

Register a web service with a health check on a Consul client, discover it over DNS and the HTTP API, watch a failed health check pull it out of results, store config in the KV store, then scale to a second instance.

45 minutes
hashicorp/consul
Register Services, Discover Them & Use the KV Store - Platform Engineering Hands-On Lab Icon
Share this Lab

Lab Overview

This is the service registration and discovery lab for the Consul 101 course. You work with a running datacenter of one Consul server and two Consul clients, each already running a small web application, and put the four core service-networking workflows into practice exactly as an operator would.

You will:

  • Register a web service with an HTTP health check on consul-client-1 using a service definition file, then confirm it appears in the catalog as passing
  • Discover the service through Consul DNS (web.service.consul on port 8600) and the HTTP catalog and health APIs, then stop the app and watch the failing health check remove the instance from passing discovery results
  • Store and manage dynamic application configuration in the Consul KV store with put, get, delete, recurse, and a check-and-set (CAS) write
  • Recover the failed instance and register a second instance on consul-client-2, then prove that DNS and the health API return both healthy instances for client-side load balancing

Everything is done against the v1 catalog workflow shipped as the stable default in Consul 2.0.x, the same commands the Section 4 lessons walk through.

What You'll Learn

Register a service with a health check using a service definition file and consul reload

Discover services through Consul DNS and the HTTP catalog and health APIs

Observe how a failing health check removes an instance from passing discovery results

Manage dynamic configuration in the KV store, including a check-and-set write

Run multiple instances of a service and return only the healthy ones from discovery

Prerequisites

Completion of the Consul 101 Section 4 (Service Registration, Discovery and the KV Store) lessons

Familiarity with the consul CLI (members, catalog, kv)

Basic Linux command line and systemd service management

Technologies Covered

consulservice-discoveryservice-registrationhealth-checksdnshttp-apikv-storecatalog

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