Serverless Blog
all
guides & tutorials
user stories
operations & observability
engineering culture
news

Introducing FONK: a serverless LAMP stack for K8S

written by  
  Pete Johnson

There's a statement about serverless I've heard too many times: "Serverless is a solution looking for a problem."

It's the kind of statement somebody makes defensively, when a new technology comes along to disrupt the workflow they're used to. It’s also the kind of statement that should reveal to all of us in the serverless community how steep the learning curve can be.

If people understood serverless, they wouldn’t say something so broadly negative. So I pose the question: How can we tame the Serverless learning curve?

The answer I came up with? A web application.

Let me explain.

Guestbook: a serverless web app example

Last spring, I heard that opening quote for the fourth time. So I asked myself, “What’s the simplest thing you can build with Serverless that someone can relate to a thing they already know?”

I thought I could show the value of Serverless by demonstrating to someone how they can do something they're doing now, just more simply.

So I built an example web app, and called it Guestbook.

Using web apps to lower the serverless learning curve

Just about everybody understands the LAMP stack.

LAMP Logo

It’s simple and provides choice among its components, which explains why it's been so popular over the last 20+ years. We see its influence even in the Kubernetes (K8S) learning curve:

Guestbook Traditional Architecture

The Guestbook is among the first applications that most people deploy when first learning Kubernetes, and although it uses a NoSQL server in place of MySQL, the same basic LAMP structure exists.

What does this mean for serverless?

With that in mind, one way to lower the serverless learning curve is to show people how to build similarly complex web applications with far less code and configuration.

Using AWS constructs, that web application would look like this:

Guestbook AWS Architecture

And while that requires about half as much code and configuration, it also locks you into AWS.

What if you could create a design pattern similar to LAMP but that used Serverless concepts on top of K8S to insure portability?

LAMP Serverless K8S

Introducing FONK: a serverless LAMP stack for K8S

The components of that AWS architecture are a Functions-as-a-Service (FaaS) runtime, an object store, and a NoSQL server.

If you used one of the five FaaS runtimes on any GitHub project that has more than 3,000 stars or other popular open source components, the entire stack is installable on top of K8S as follows:

Guestbook FONK Architecture

Put all that together, and you get a tidy acronym for a serverless design pattern:

FONK Logo

(I owe the animal icon to my daughter who said, “FONK sounds like something a goose would say.”)

Implementing Guestbook on FONK

In September, some friends and I soft-launched fonk-apps.io, an open source project with the goal of lowering the Serverless learning curve for people. It does this by providing simple web app examples in every possible language.

In an attempt to make the transition from native K8S easier for people, the first of these web app examples is the Guestbook. Here’s our early progress:

FONK Guestbook Progress

While Guestbook, which has only Create and List functions, was a natural first choice, the plan was to get more sophisticated with the applications. We wanted to add things like ToDos (full CRUDL operations), a blog (authenticated CUD, public RL), and a forum (authenticated CRUDL).

Longer term, it would be cool to build in some CI/CD with some test automation down the columns or performance benchmarking across the rows as well.

FaaS runtimes compared

In the process of building out this first set of examples, we’ve learned a great deal about comparing and contrasting the FaaS runtimes with one another.

From a developer experience perspective, here are some early findings:

FaaS on K8S Landscape

The development experience on some of the FaaS on K8S runtimes is closer to native K8S development; it exposes some of the innards of the image upon which the function will run. Others are closer to the AWS Lambda model that obscures image details.
The 800-pound gorilla in this space is Knative from Google, which hasn’t yet reached the 3,000 GitHub star threshold that would warrant a Guestbook example. But we’re keeping our eye on its progress, as it will likely get there.

Come join the fun!

Once this idea got going, we thought it would be much better with a community of people around it. So, we’ve tried to make the whole thing an inviting place.

While not all of the FaaS on K8S runtimes support the Serverless Framework, Kubeless and OpenWhisk do very nicely. An easy way for you to get started would be for you walk through a completed example:

We’d be appreciative of a GitHub star from you, but we’d love a PR of a new FaaS runtime/language combination even more. 😉

Come check us out at the FONK project on GitHub, and try some of the examples yourself. Or feel free to call dibs on a FaaS/language combination as we build out all the Guestbook examples possible!

About Pete Johnson

Pete Johnson is a 20+ year tech industry veteran who has worked for companies large and small.

 - 18.05.17

Getting Started with the Serverless Framework [Video Tutorial]

Serverless lead front-end engineer Nik Graf shows you how to get started writing and deploying functions with the Serverless Framework.

written by Nik Graf

news - 06.12.17

Introducing OpenEvents

Announcing a specification for describing event data in a common way

written by Austen Collins

Join 12,000+ other serverless devs & keep up to speed on the latest serverless trends.

Join 12,000+ other serverless devs & keep up to speed on the latest serverless trends.

Made with love in San Francisco + Atlanta, Austria, Germany, Pakistan, Poland, Nebraska & Thailand

Serverless, Inc. © 2018

Join our newsletter and get the latest news about Serverless products and happenings. #noSpamWePromise