concept Envoy proxy in category microservice

appears as: The Envoy proxy, Envoy proxy, n Envoy proxy, Envoy proxies
Microservices Security in Action

This is an excerpt from Manning's book Microservices Security in Action.

Figure 12.6 The Istio Ingress gateway intercepts all the requests coming to the microservice and terminates the TLS connection. The communications between the Ingress gateway and microservices, as well as among microservices, are protected with mTLS. The Envoy proxy does JWT verification for the Order Processing and Inventory microservices.
  • Load balancing --The Envoy proxy can act as a load balancer for upstream services. When one microservice talks to another microservice, that request first goes through the Envoy proxy sitting with the first microservice (figure K.5). This envoy proxy can act as a load balancer for the second microservice, which is called the upstream microservice. Envoy supports advanced load-balancing features including automatic retries, circuit breaking, global rate limiting, request shadowing, zone local load balancing, and so on. You can learn more about Envoy load balancing features from the Envoy documentation available at http://mng.bz/rr1e.
  • Figure K.5 Envoy carries out load balancing for upstream services.
  • Observability --The four main pillars of observability are metrics, tracing, logging, and visualization. Each of these factors is important to monitoring a microservice effectively. In appendix D, we discuss these four pillars and the need for observability in detail. An Envoy proxy that intercepts all the requests (in and out) from a microservice is in a great position to generate statistics in a transparent manner. It generates stats at three levels: downstream, upstream, and server. The downstream stats are related to all the incoming connections, while the upstream stats are related to all the outgoing connections. The server stats are related to the health of the Envoy proxy itself; for example, CPU, memory usage, and so on. Envoy publishes all the stats it collects to Mixer. Mixer is an Istio control-plane component that we discuss in section K.3.3. Envoy doesn’t need to publish stats for each request; rather, it can cache the stats and then (infrequently) push to Mixer. Unlike in a monolithic deployment, in a typical microservices deployment when a request spans across multiple endpoints, logs and stats are just not enough. There should be a way to correlate logs between endpoints. When an Envoy proxy initiates a request to an upstream service, it generates a unique identifier to trace the request and sends it as a header to the upstream service. When the Envoy proxy publishes its downstream stats to the Mixer, it also publishes the corresponding tracing identifiers. Also, if one upstream service wants to talk to another upstream service, it passes through the tracing identifier it gets from the first downstream service. With this model, when all the stats generated from Envoy proxies are collected centrally, we can build a complete picture of each request by correlating tracing identifiers. In section K.4.2, you’ll learn more about how Istio handles tracing at the control plane. You can read more about the observability support in Envoy at http://mng.bz/Vg2W.