Run Envoy¶
The following instructions walk through starting Envoy as a system daemon or using the Envoy Docker image.
Check your Envoy version¶
Once you have installed Envoy, you can check the version information as follows:
$ envoy --version
$ docker run --rm \
envoyproxy/envoy-dev:6c7bcb6d94cac10469b2bb691d3f759a86fd86e7 \
--version
View the Envoy command line options¶
You can view the Envoy command line options with the --help
flag:
$ envoy --help
$ docker run --rm \
envoyproxy/envoy-dev:6c7bcb6d94cac10469b2bb691d3f759a86fd86e7 \
--help
Run Envoy with the demo configuration¶
The -c
or --config-path
flag tells Envoy the path to its initial configuration.
To start Envoy as a system daemon download the demo configuration
, and start
as follows:
$ envoy -c envoy-demo.yaml
You can start the Envoy Docker image without specifying a configuration file, and it will use the demo config by default.
$ docker run --rm -d \
-p 9901:9901 \
-p 10000:10000 \
envoyproxy/envoy-dev:6c7bcb6d94cac10469b2bb691d3f759a86fd86e7
To specify a custom configuration you can mount the config into the container, and specify the path with -c
.
Assuming you have a custom configuration in the current directory named envoy-custom.yaml
:
$ docker run --rm -d \
-v $(pwd)/envoy-custom.yaml:/envoy-custom.yaml \
-p 9901:9901 \
-p 10000:10000 \
envoyproxy/envoy-dev:6c7bcb6d94cac10469b2bb691d3f759a86fd86e7 \
-c /envoy-custom.yaml
Check Envoy is proxying on http://localhost:10000
$ curl -v localhost:10000
The Envoy admin endpoint should also be available at http://localhost:9901
$ curl -v localhost:9901
Override the default configuration by merging a config file¶
You can provide a configuration override file using --config-yaml
which will merge with the main
configuration.
Save the following snippet to envoy-override.yaml
:
listeners:
- name: listener_0
address:
socket_address:
port_value: 20000
Next, start the Envoy server using the override configuration.
$ envoy -c envoy-demo.yaml --config-yaml envoy-override.yaml
$ docker run --rm -d \
-v $(pwd)/envoy-override.yaml:/envoy-override.yaml \
-p 20000:20000 \
envoyproxy/envoy-dev:6c7bcb6d94cac10469b2bb691d3f759a86fd86e7 \
--config-yaml /envoy-override.yaml
Envoy should now be proxying on http://localhost:20000
$ curl -v localhost:20000
The Envoy admin endpoint should also be available at http://localhost:9901
$ curl -v localhost:9901