New serverless framework for Kubernetes focuses on developer productivity
Fission is a new framework for serverless functions on Kubernetes. It focuses on high performance and developer productivity by allowing developers focus on the task and hand, not on infrastructure. Fission is still in early alpha, so you should not use it in production just yet.
Fission is a framework for serverless functions on Kubernetes which keeps both Kubernetes and Docker abstracted away under normal operation in order to help developers focus on the task at hand, not on infrastructure. However, you can use both to extend Fission if you want to.
Fission is extensible to any programming language (out of the box, it comes with Python and NodeJS support but more languages are coming soon). Its core is written in Go and language-specific parts are isolated in environments. Plus, the framework it fast: it maintains a pool of “warm” containers, each containing a small dynamic loader. When a function is “cold-started” (first called) a running container is chosen and the function is loaded. Cold-start latencies are usually about 100msec.
According to the project description, Fission is built on top of Kubernetes because its creators “think any non-trivial app will use a combination of serverless functions and more conventional microservices, and Kubernetes is a great framework to bring these together seamlessly.” Furthermore, anything you do for operations on your Kubernetes cluster — such as monitoring or log aggregation — also helps with ops on your Fission deployment.
Let’s dive into some of the framework’s concepts:
- A function represents a piece of code which follows the fission function interface.
- The environment encompasses of the language- and runtime-specific parts of running a function (An environment is essentially just a container with a webserver and dynamic loader.)
- A trigger maps an event to a function; Fission supports HTTP routes as triggers but support for other types of event triggers will be coming soon.
This is how it works:
How to compile Fission
What you need:
- the glide dependecy management tool
- docker for building images
How to do it:
The server side is compiled as one binary (“fission-bundle”) which contains controller, poolmgr and router; it invokes the right one based on command-line arguments.
To build fission-bundle: clone this repo, then from the top level directory
# Get dependencies $ glide install # Build fission server and an image $ pushd fission-bundle $ ./build.sh # Edit push.sh to point to your registry $ $EDITOR push.sh $ ./push.sh $ popd # To install, update fission.yaml to point to your compiled image $ $EDITOR fission.yaml $ kubectl create -f fission.yaml
If you are changing the CLI
# Build Fission CLI $ cd fission && go install
Don’t forget that Fission is still in early alpha, so using it in production is not recommended right now.