Installing a Consul demo application

To explore the service mesh capabilities of Consul through a Kubernetes environment, we will install a demo application that is available from Hashicorp. This demo uses two simple services: a counting service and a frontend web UI service (connects to the counting service to show the results). Let's get started:

  1. Let's take a look at the counting pod definition, which shows counting and a counting-init container:
# Counting podapiVersion: v1kind: Podmetadata:  name: counting  annotations:    "consul.hashicorp.com/connect-inject": "true"spec:  containers:  - name: counting    image: hashicorp/counting-service:0.0.2    ports:    - containerPort: 9001      name: http  initContainers:  - name: counting-init image: hashicorp/counting-init:0.0.9 ...

Get Mastering Service Mesh now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.