Envoy as an Inter DC Traffic Manager (Part 1) — Mocking multi DC traffic flow in a local K8s cluster

Why Envoy?

Use Case

  1. Routing requests based on:
  • Upstream service
  • Individual API path|route
  • Percentage of traffic

Mock Environment Design

Mock Environment

Setting Up the Mock Environment

  1. Install a local K8s cluster (Minikube or Docker Desktop) and kubectl
  2. Clone this repository
  3. Change path to the repository and run kubectl apply -f ./k8s as below

Bootstrapping the Traffic Manager Envoy

Route config
Cluster config
Envoy log
  1. route|path level routing using the routes -> [match -> path] config.
  2. Support for both HTTP2/gRPC by setting clusters -> [cluster -> protocol_selection] as USE_DOWNSTREAM_PROTOCOL which switches the HTTP protocol version used by Envoy depending on the version in the incoming request.
  3. Observability: By means of configuring access logs of Envoy using a json_format file access log.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amal Aruja

Amal Aruja

Senior Consultant | Trekking & Cycling enthusiast