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

Fission: a FaaS for Kubernetes @ SCALE16x

Fission: a FaaS for Kubernetes @ SCALE16x

Slides for the Fission.io talk at So-Cal Linux Expo, March 2018.

Avatar for Soam Vasani

Soam Vasani

March 11, 2018
Tweet

More Decks by Soam Vasani

Other Decks in Technology

Transcript

  1. Starting out with Kubernetes is too hard • Before you

    can run your program: • build a container image, push it to a registry • write a Deployment specification with a Pod specification in it • write a Service • create an Ingress (hopefully you have an ingress controller set up) • Rebuild container image on changes
  2. Runtime resource usage • Rarely-used services still use a minimum

    amount of resources • Cluster capacity: Number of deployments vs amount of usage • Services should be nearly free when idle
  3. What if? • We had the power of containers and

    Kubernetes, but with lightweight dev workflows? • We could have cluster capacity that’s proportional to actual usage?
  4. What if? • We had the power of containers and

    Kubernetes, but with lightweight dev workflows? • We could have cluster capacity that’s proportional to actual usage? Functions as a Service!
  5. Scaling up from zero • Services should be ~free when

    idle • Services should be fast when needed • These two goals require fast “cold starts”
  6. Fission: a FaaS for Kubernetes • Short-lived stateless “functions” •

    Defined declaratively at the source-level • Functions free when idle: Started quickly on-demand
  7. HTTP, NATS, Kafka, Azure Storage Queues, Kubernetes Watches, Timers, …

    NodeJS, Python, Go, Ruby, C#, PHP, Bash(!), Perl
  8. Fission: how it works • Function Storage • Executor: Put

    functions into pods and run them • HTTP Router • Other Trigger Implementations
  9. Function Executors • Pool-based executor: low-latency, small idle overhead •

    “Pre-warmed” pool of environment containers • Functions loaded into containers on-demand • New-deployment executor: high latency, no idle overhead
  10. Application Config Management • Action-based CLIs great for starting out

    • But they make it hard to repro on another cluster, keep track of changes, do idempotent deploys, etc.
  11. Declarative App Specs • Declarative specifications great for source control,

    updating existing apps, and idempotent behavior • But they’re not great for new users • There’s too much YAML to write from scratch
  12. Config by Example • “Save what I’m doing on this

    cluster so I can do it on another cluster” • Generate declarative specs, check them into source control with your app • No writing new YAMLs!!
  13. Scaling Functions at Runtime • Fission gives you some control

    over runtime properties • Autoscaling: Min, max instances • Min Instances: Idle cost vs. Burst tolerance • Max Instances: Throughput vs Cost
  14. Function Composition • Lots of ways to do it! •

    Just make the function bigger • Call other functions over HTTP • Pipe function in/out over a Message Queue (NATS, Kafka etc)
  15. Function Composition • Simple approaches work for a few functions

    • None of these have a holistic view of the system • How do we deal with inter-function compatibility? • How do we do incremental upgrades?
  16. Fission Workflows • Create a “flowchart” of functions • No

    explicit HTTP or RPC calls • Fission Workflows co-ordinates data and control flow • Workflows are lightweight, extensible, fault-tolerant
  17. Fission Workflows Internals • Event-sourcing using NATS-streaming • Tolerate restarts

    of any nodes/pods; restarts the workflow from the right place • Write workflows in a simple YAML (more languages coming)
  18. Status and Roadmap • Fission in late alpha/early beta •

    1.0 Coming Soon • Fission-Workflows beta late 2018 • Stability, security, performance
  19. Roadmap • More triggers integrations: Events from various AWS, Google,

    Azure cloud services • Better Operational experience: • Istio, Prometheus, overall observability of the system • Lots of progress on Fission Workflows