使用 Docker 快速开始

Quick Start instructions to install and configure Istio in a Docker Compose setup.

前置条件

安装步骤

  1. 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:

    1. curl -L https://git.io/getLatestIstio | sh -
  2. Extract the installation file and change the directory to the file location. The installation directory contains:

    • Sample applications in samples/
    • The istioctl client binary in the bin/ directory. istioctl is used for creating routing rules and policies.
    • The istio.VERSION configuration file
  3. Add the istioctl client to your PATH. For example, run the following command on a MacOS or Linux system:

    1. export PATH=$PWD/bin:$PATH
  4. Change directory to the root of the Istio installation directory.

  5. Bring up the Istio control plane containers:

    1. docker-compose -f install/eureka/istio.yaml up -d
  6. Confirm that all docker containers are running:

    1. docker ps -a

    If the Istio Pilot container terminates, ensure that you run the istioctl context-create comamnd and re-run the command from the previous step.

  7. Configure istioctl to use mapped local port for the Istio API server:

    1. istioctl context-create --context istio-local --api-server http://localhost:8080

部署应用

You can now deploy your own application or one of the sample applications provided with the installation like BookInfo.

Note 1: 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.

Note 2: the application must use HTTP/1.1 or HTTP/2.0 protocol for all its HTTP traffic because HTTP/1.0 is not supported.

  1. docker-compose -f <your-app-spec>.yaml up -d

卸载

  1. Uninstall Istio core components by removing the docker containers:
  1. docker-compose -f install/eureka/istio.yaml down

下一步