Skip to content

Latest commit

 

History

History
86 lines (62 loc) · 1.83 KB

ENVOY.md

File metadata and controls

86 lines (62 loc) · 1.83 KB

PoC: Running the PoC locally on envoy in docker-compose

Please note: this version has a static control-plane where service status is managed manually. The kubernetes version has automatic detection of scaled-to-zero services.

Architecture

In Envoy the high-level architecture looks like this:

envoy-overview

Demo

For more info about the demo see the scripts in demo

Local setup

brew tap tinygo-org/tools
brew install tinygo

Ports

Building + running

make build-wasm && docker-compose -f local-envoy/docker-compose.yaml up

Setting hosts to scaled to zero

The control-plane returns a list of which services are "scaled-to-zero" (dummy):

# Get current list
curl localhost:7001/ 
[]
# Setting a service to "scaled to zero" or unset "scaled to zero"
curl -X POST "localhost:7001/set-scaled-to-zero?host=http.example.com"
curl -X POST "localhost:7001/set-scaled-to-zero?host=grpc.example.com"

Testing directly

# HTTP
curl localhost:50001
Hello from HTTP Server
# GRPC
grpcurl -plaintext localhost:50002 grpc.health.v1.Health/Check
{
  "status": "SERVING"
}

Testing via Envoy

# HTTP
curl localhost:9000 -H 'Host: http.example.com'
Hello from HTTP Server
# GRPC
grpcurl -plaintext -authority grpc.example.com localhost:9000 grpc.health.v1.Health/Check
{
  "status": "SERVING"
}