## To get started [Link here](https://www.envoyproxy.io/docs/envoy/latest/start/start) 1. Clone the [envoy repo](https://github.com/envoyproxy/envoy) into workspace. `git clone https://github.com/envoyproxy/envoy.git` 2. cd into the `configs` directory and modify the `Dockerfile` 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 ``` 3. Build and run the Dockerfile ``` docker build -t envoy-google-test:v1 . docker run -d -p 10000:10000 envoy-google-test:v1 ``` 4. 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. 5. The basic envoy config is located at `etc/envoy.yaml`. Start the envoy process ``` cd etc envoy -c envoy.yaml ``` 6. 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 has `server: envoy`. Now go forth and mess around with the Envoy config! ## Types of load balancing For a cluster, you can define a [lb policy](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/cds.proto#enum-cluster-lbpolicy). For a HTTP route, you can define [weights](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route.proto.html#route-weightedcluster) 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. ## Helpful links Envoy documentation can be [found here](https://www.envoyproxy.io/docs/envoy/latest/about_docs). You will want to be using the [v2 api](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api).