Envoy

Configuration

Envoy can be configured dynamically in real time without any downtime.
    Listener discovery service  —  configures on what ports envoy listens on, and the action to take on the incoming connections.
    Cluster discovery service  —  configures the upstream clusters. Envoy will route incoming connections/requests to these clusters.
    Route discovery service  —  configures L7 routes for incoming requests.
    Endpoint discovery service  —  allows envoy to dynamically discover cluster membership and health information.
    Secret discovery service  —  allows envoy to discover ssl secrets. This is used to configure ssl secrets independently of the listener, and allows to provide ssl secrets from a local node, instead of a centralized control plane.
Best Practice: Here we are using partitioned file-based dynamic configuration.

Start

1
# minikube mount /Users/schintha/Developer/Work:/Work
2
# mount '/Work/SPA/yeti/envoy.yaml:/etc/envoy/envoy.yaml'
3
docker-compose up envoy
4
5
# (or) start standalone envoy container
6
docker run -it --rm --name envoy2 \
7
-p 9901:9901 -p 9090:9090 -p 9444:9443 \
8
-v `pwd`/config/base/envoy/config/:/etc/envoy:ro \
9
-v `pwd`/config/certs/:/etc/certs:ro \
10
envoyproxy/envoy-alpine:v1.14.1
11
# ssh if needed
12
docker exec -it envoy /bin/bash
Copied!

Test

1
curl '<http://localhost:9090/greetersrv/Greeter.Hello'> \
2
-H 'Content-Type: application/grpc-web+proto' \
3
-H 'X-Grpc-Web: 1' \
4
-H 'custom-header-1: value1' \
5
-H 'Accept: */*' \
6
-H 'Connection: keep-alive' \
7
--data-binary $'\x00\x00\x00\x00\x05\n\x03abc' --compressed
8
9
curl '<http://localhost:9090/greetersrv/Greeter.Hello'> \
10
-H 'Content-Type: application/json' \
11
-d '{
12
"name": "sumo"
13
}'
14
15
curl '<http://localhost:9090/yeti.EchoService/Echo'> \
16
-H 'Content-Type: application/grpc-web+proto' \
17
-H 'X-Grpc-Web: 1' \
18
-H 'custom-header-1: value1' \
19
-H 'Accept: */*' \
20
-H 'Connection: keep-alive' \
21
--data-binary $'\x00\x00\x00\x00\x05\n\x03abc' --compressed
22
23
curl '<http://localhost:9090/yeti.EchoService/Echo'> \
24
-H 'Accept: application/grpc-web-text' \
25
-H 'Content-Type: application/grpc-web-text' \
26
-H 'X-Grpc-Web: 1' \
27
-H 'Connection: keep-alive' \
28
-H 'Accept-Encoding: gzip, deflate, br' \
29
-d '{
30
"message": "sumo"
31
}'
32
33
curl '<http://localhost:8080/travelbob.blogs.BlogsAPI/GetAllBlogs'> \
34
-H 'Accept: application/grpc-web-text' \
35
-H 'Content-Type: application/grpc-web-text' \
36
-H 'X-Grpc-Web: 1' \
37
-H 'Connection: keep-alive' \
38
-H 'Accept-Encoding: gzip, deflate, br' \
39
--data-binary 'AAAAAAA=' --compressed
Copied!

Reference

Last modified 9mo ago