FLAME.K8sBackend (FLAME Kubernetes Backend v0.1.2)

Copy Markdown View Source

The FLAME.Backend using Kubernetes system.

This backend creates FlameRunner CRD resources which are then reconciled by the flame-k8s-controller to create actual runner pods.

Configuration

Configure the flame backend in your application:

# config.exs
if config_env() == :prod do
  config :flame, :backend, FLAME.K8sBackend
  config :flame, FLAME.K8sBackend,
    log: :debug,
    boot_timeout: 30_000
end

How it works

  1. Parent application calls FLAME.cast/3 or FLAME.call/3
  2. Backend creates a FlameRunner CRD in Kubernetes
  3. flame-k8s-controller detects the FlameRunner and creates a Pod
  4. Pod starts and connects back to parent via distributed Erlang
  5. Work is executed on the runner
  6. Runner terminates and FlameRunner/Pod are cleaned up