Difficulty: Beginner
Estimated Time: 20 minutes

Consul Connect

In this hands-on lab, you'll start two services and connect them over a TLS encrypted proxy with Consul Connect. Integrating applications with Consul Connect is as easy as talking to a port on localhost.

The front end will be a demo dashboard web application that displays a number. The backend will be a counting service that serves a JSON feed with a constantly incrementing number.

The front end uses websockets to update its user interface every few seconds with fresh data from the backend counting service.

You'll spend most of your time executing commands against our demo applications (dashboard and counting), but Consul works to help services discover each other and connect through encrypted proxies.

We've configured Consul for you and started a single agent, so it's ready to go. Let's get started!

Congratulations!

You've configured Consul Connect by completing the following steps:

  • Configure a backend service to run on a specific port with a name
  • Configure a front-end service to proxy to an upstream service over a local port
  • Deny connections by default with an intention
  • Allow specific communication between services with an intention

Continue your education by reading more about Consul Connect on the HashiCorp guides.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Consul Connect

Step 1 of 4

Start the backend counting service

EXPERIMENTAL

Execute host01

cat /etc/consul.d/counting.json

Execute host02

cat /etc/consul.d/counting.json

Execute T1

cat /etc/consul.d/counting.json

Execute T2

cat /etc/consul.d/counting.json