Changing a bit the subject of this blog, I’ve been studying about serverless and some frameworks. And today we’re gonna talk a bit about Fission. I’ll not explain the basics about serverless, but maybe it’s a subject for a future post :)

What’s Fission?

Fission is a framework for serverless functions running on the top of Kubernetes. It runs on premise, on cloud or locally.

The main idea is to write short-lived functions to be ran based on a trigger. Fission supports a small amount of triggers: HTTP, timer, webhooks like slack and github and Kubernetes events.

The image below shows how it’s structured.

Image for post
Image for post

Fission has its router which does all the routing job, like receiving the HTTP requests, triggering from a webhook, etc.

It takes care of the rest: deployment, routing, scalability, availability. Use Kubernetes’ service discovery and networking to interoperate with other services, like Redis, Postgres, Etcd etc.

How to?

First step after instalation is to create the environment. Here I’m saying we’re gonna run with nodejs version 0.4.1, it also supports higher versions like 8.

Image for post
Image for post

Next step is to create your function based on the env if requires, in this case we’re using nodejs env and our function code is on hello.js

Image for post
Image for post

Next step is to expose your function with a HTTP verb and a URI, in this case it’ll be a GET to /hello

Image for post
Image for post

Last but not least, we need to call our function :) in this case we’re using curl to do it. As I called it from the terminal, I used a env var created by fission called FISSION_ROUTER, but we can use the IP and call from wherever we want.

Image for post
Image for post

Triggers

  • HTTP (previous example)

Languages and environments supported

Image for post
Image for post

Impressions

After installing and playing with it locally, I had my impressions about Fission, and I’d like to share with you.

  • Documentation is good;

Pre requisites is to understand how kubernetes work, what’s serverless and docker.

Font: http://fission.io/

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store