Skip to content

Traffic endpoint and graceful shutdown for Elixir Plug apps

Notifications You must be signed in to change notification settings

CrazyEggInc/k8s_traffic_plug

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Traffic Plug

Support for graceful server shutdown under Kubernetes termination life-cycle.

The plug supports a /__traffic endpoint which normally returns 200. When the VM receives a SIGTERM signal, the endpoint starts returning HTTP error code 500, which, when used with an HTTP readinessProbe, ensures that traffic is routed away from the pod, before a delayed graceful shutdown begins.

See modules for detailed documentation, also my blog post, Graceful shutdown on Kubernetes with signals & Erlang OTP 20.

Installation

def deps do
  [
    {:k8s_traffic_plug, github: "CrazyEggInc/k8s_traffic_plug"}
  ]
end

About

Traffic endpoint and graceful shutdown for Elixir Plug apps

Topics

Resources

Stars

Watchers

Forks

Languages

  • Elixir 77.0%
  • Erlang 17.2%
  • Nix 5.7%
  • Shell 0.1%