-
Clone the envoy repo into workspace.
git clone https://github.com/envoyproxy/envoy.git
-
cd into the
configs
directory and modify theDockerfile
so that it has the following
# This configuration will build a Docker container containing
# an Envoy proxy that routes to Google.
FROM envoyproxy/envoy:latest
RUN apt-get update
COPY google_com_proxy.v2.yaml /etc/envoy.yaml
CMD tail -f /dev/null
- Build and run the Dockerfile
docker build -t envoy-google-test:v1 .
docker run -d -p 10000:10000 envoy-google-test:v1
- Open a second window and shell into the docker container
export ENVOY_CONTAINER=$(docker ps | sed "1 d" | cut -d" " -f 1)
docker exec -it $ENVOY_CONTAINER "/bin/sh"
The script above gets the container id assuming you only have 1 docker container running.
- The basic envoy config is located at
etc/envoy.yaml
. Start the envoy process
cd etc
envoy -c envoy.yaml
- From the first window, you can now see the Envoy is proxying traffic by running
curl -v -o /dev/null localhost:10000
and seeing that the header hasserver: envoy
.
Now go forth and mess around with the Envoy config!
For a cluster, you can define a lb policy.
For a HTTP route, you can define weights amongst the clusters it will send traffic to.
Which method of load-balancing you use depends on the data mapping of Envoy-to-CF concepts.
Envoy documentation can be found here. You will want to be using the v2 api.
Apparently it will only update based on a file system watch on a symlinked file https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/runtime.html#arch-overview-runtime