3.1 KiB
title | overview | order | layout | type |
---|---|---|---|---|
Istio with Consul | This sample deploys the Bookinfo application in a simple Docker Compose environment using Consul as the service registry, and demonstrates various features of the Istio service mesh on non-kubernetes platforms. | 60 | docs | markdown |
{% include home.html %}
This sample deploys the Bookinfo application in a simple Docker Compose environment using Consul as the service registry, and demonstrates various features of the Istio service mesh on non-kubernetes platforms.
Before you begin
- Install Docker and Docker-Compose
Overview
For the purposes of illustration, this sample deploys the Istio control plane and the BookInfo application in a simple Docker Compose based setup. Since there is no concept of pods in a Docker setup, the Istio sidecar runs in the same container as the application. We will use Registrator to automatically register instances of services in the Consul service registry.
Setup
-
Go to the Istio release page, to download the installation file corresponding to your OS. Alternatively, run the following command to download and extract the latest stable release automatically (on MacOS and Ubuntu).
curl -L https://git.io/getIstio | sh -
-
Extract the installation file, and change directory to the location where the files were extracted. The following instructions are relative to this installation directory. The installation directory contains:
- Sample applications in
samples/
- The
istioctl
client binary in thebin/
directory.istioctl
is used for creating routing rules and policies. - The
istio.VERSION
configuration file.
- Sample applications in
-
Add the
istioctl
client to your PATH. For example, run the following commands on a Linux or MacOS system:export PATH=$PWD/bin:$PATH
-
Generate a configuration file which will be used by
istioctl
and Istio Pilotistioctl context-create --api-server http://172.28.0.13:8080
-
Change directory to the root of the Istio installation directory.
-
Bring up the Istio control plane and the application containers:
docker-compose -f samples/bookinfo/consul/docker-compose.yaml up -d
-
Confirm that all docker containers are running:
docker ps -a
If the
Istio-Pilot
container terminates, re-run the command from the previous step. -
View the Bookinfo web page at
http://localhost:9081/productpage
. If you refresh the page several times, you should see different versions of reviews shown in productpage presented in a round robin style (red stars, black stars, no stars).
Tasks
Cleaning up
Remove all docker containers:
docker-compose -f samples/bookinfo/consul/docker-compose.yaml down