Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building an Autoscaling HTTP Proxy for Kubernetes - Aaron Schlesinger

Building an Autoscaling HTTP Proxy for Kubernetes - Aaron Schlesinger

GopherCon Russia

April 23, 2021
Tweet

More Decks by GopherCon Russia

Other Decks in Programming

Transcript

  1. HTTP Proxies on Kubernetes HTTP Proxies on Kubernetes Aaron Schlesinger,

    Microsoft Aaron Schlesinger, Microsoft @arschles
  2. The Origin The Origin Not in a “stable” location. Not

    in a “stable” location. Often stateless. Often stateless. Controlled by other software. Controlled by other software.
  3. The Scaler The Scaler Adds/removes origin replicas automatically. Adds/removes origin

    replicas automatically. Communicates with proxy. Communicates with proxy.
  4. The Proxy The Proxy Stateless Stateless Acts on (1) incoming

    requests and (2) scaler changes Acts on (1) incoming requests and (2) scaler changes Handles origin faults Handles origin faults
  5. Proxy Patterns Proxy Patterns wait = hold inbound request until

    scaler says >0 replicas. = hold inbound request until scaler says >0 replicas. forward = attempt connection and forward HTTP request. = attempt connection and forward HTTP request. Use inbound http.Request.Context() for everything in the proxy
  6. Building Your Own Building Your Own Applicable even outside Kubernetes.

    Applicable even outside Kubernetes. Keep proxy as stateless as possible. Keep proxy as stateless as possible. Minimize and simplify RPC calls. Minimize and simplify RPC calls.