2.9 KiB
| title | description | weight | keywords | |
|---|---|---|---|---|
| Quick Start on Docker | Quick Start instructions to setup the Istio service mesh with Docker Compose. | 10 |
|
Quick Start instructions to install and configure Istio in a Docker Compose setup.
Prerequisites
Installation steps
-
Go to the Istio release page to download the installation file corresponding to your OS. If you are using a macOS or Linux system, you can also run the following command to download and extract the latest release automatically:
{{< text bash >}} $ curl -L https://git.io/getLatestIstio | sh - {{< /text >}}
-
Extract the installation file and change the directory to the file location. The installation directory contains:
- Sample applications in
samples/ - The
istioctlclient binary in thebin/directory.istioctlis used for creating routing rules and policies. - The
istio.VERSIONconfiguration file
- Sample applications in
-
Add the
istioctlclient to your PATH. For example, run the following command on a macOS or Linux system:{{< text bash >}} $ export PATH=$PWD/bin:$PATH {{< /text >}}
-
For Linux users, configure the
DOCKER_GATEWAYenvironment variable{{< text bash >}} $ export DOCKER_GATEWAY=172.28.0.1: {{< /text >}}
-
Change directory to the root of the Istio installation directory.
-
Bring up the Istio control plane containers:
{{< text bash >}} $ docker-compose -f install/consul/istio.yaml up -d {{< /text >}}
-
Confirm that all docker containers are running:
{{< text bash >}} $ docker ps -a {{< /text >}}
If the Istio Pilot container terminates, ensure that you run the
istioctl context-createcommand and re-run the command from the previous step. -
Configure
istioctlto use mapped local port for the Istio API server:{{< text bash >}} $ istioctl context-create --api-server http://localhost:8080 {{< /text >}}
Deploy your application
You can now deploy your own application or one of the sample applications provided with the installation like Bookinfo.
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.
The application must use HTTP/1.1 or HTTP/2.0 protocol for all its HTTP traffic because HTTP/1.0 is not supported.
{{< text bash >}} $ docker-compose -f .yaml up -d {{< /text >}}
Uninstalling
Uninstall Istio core components by removing the docker containers:
{{< text bash >}} $ docker-compose -f install/consul/istio.yaml down {{< /text >}}