“On-Premises” FaaS on Kubernetes: Webinar Recap and Q&A

Last week, I hosted a Cloud Academy webinar about open-source FaaS and FaaS on Kubernetes. If you missed the live event, you can watch it here.

In this post, I’d like to briefly recap some of the main topics covered, including a high-level introduction to FaaS and an overview of the main open-source projects. Also, I will be answering all of the questions that we received during the webinar, including the ones that I didn’t have time to answer during the live event.

Faas on Kubernetes: Webinar Agenda

My agenda included the following points:

  1. What does FaaS mean?
  2. FaaS in the open-source world
  3. FaaS frameworks for Kubernetes
  4. Pros & Cons of “on-premises” FaaS

Let me explain why “on-premises” is in quotes here: FaaS was born in the public cloud, and here I wanted to explore alternative ways of building your own FaaS platform, either in your own private cloud or on top of the IaaS layer of a public cloud.

While Kubernetes is not the only container orchestration system available, I decided to focus on a couple of open-source FaaS frameworks for Kubernetes that have been announced recently: Funktion and Fission.

What does FaaS mean?

The concept of Function as a Service (FaaS) was born with AWS Lambda, and it kept growing as one of the core components of the serverless movement. I would actually refer to FaaS as the main component. Without the ability to bring your own code and execute it on demand, serverless would just represent brainless outsourcing.

On Wikipedia, FaaS is directly compared with PaaS (Platform as a Service) solutions. This is a crucial point for many skeptics, in my opinion.

It reads:

In most PaaS systems the system continually runs at least one server process and even with auto scaling a number of longer running processes are simply added or removed meaning that scalability is more visible to the developer as a problem.

The first key point is that, even if the underlying architecture is very similar, PaaS developers have to explicitly take care of scalability concerns since, for the most part, the concept of “server” is still part of their daily workflow. With FaaS, you no longer have to think of servers or containers. Understanding how containers are handled under the hood is always useful, of course.
Quoting Wikipedia again:

In a FaaS system, the functions are expected to start within milliseconds in order to allow handling of individual requests. In a PaaS systems, by contrast, there is typically an application thread which keeps running for a long period of time and handles multiple requests.

This is the second key point, which has a direct effect on the corresponding pricing model. Indeed, FaaS will only charge you for the actual execution time of your function, rather than the whole application container life.

Roughly speaking, I identified the following minimum requirements of FaaS:

  • Function as the unit of delivery: Each function should be an independent unit of delivery and deployment with its own configuration and properties (e.g. versions, env. variables, permissions, etc.)
  • Multi-language support & BYOC: You could potentially develop each function with a different programming language. In other words, you can Bring Your Own Code and your programming language of choice as well.
  • Transparent scaling & PAYG: High availability and scalability should be as transparent as possible without any impact whatsoever on the development or deployment process. This should hold both for performance and pricing, meaning that you will automatically pay-as-you-go on a weekly or monthly basis.
  • No infrastructure management: As a direct consequence of the previous point, you shouldn’t have to interact with the underlying infrastructure unless your FaaS platform is running on your “on-premises” cluster and you are responsible for such infrastructure as well. We will discuss the pros and cons of this use case later in this post.

So, how do you deal with FaaS, as a developer? These are the most common concepts and tasks that you need to know:

  • Independent functions development: This is what you’d hopefully do most of the time if the framework/platform allows you to automate a large amount of the following tasks.
  • Versioning & staging (nice-to-have): Unfortunately, not every FaaS platform offers native versioning and staging environments, but I’d say that this is a critical requirement for stable and mature FaaS platforms.
  • Cross-team collaboration: In order to speed up your team, you may need collaboration tools and role-based permissions that are well integrated with your versioning and staging functionalities.
  • Automated workflow: Automation is not always required for FaaS solutions that lack a lot of features such as versioning or events mapping. An automation framework becomes a core component of your stack as soon as you have a complex application built with FaaS.
  • Triggers/Events: The way you invoke functions can vary based on the specific FaaS platform, but you will always need a flexible and stable tool to track down what’s being invoked, how, and when. Things can get very complicated when you need to update such trigger configurations, especially if you haven’t followed all of the recommended best practices.
  • Local unit testing: Unit testing is recommend with FaaS as well as with any other programming stack, although FaaS often requires deep integration with the corresponding cloud environment, and you may need to learn how to mock it properly.
  • Integration tests: Testing every component of a FaaS can be tricky, especially if you consider how many things can’t be tested locally and how many can easily go wrong in a real environment. Ideally, you should have adequate tools to test and identify problems at each step (function code, trigger configuration, deployment process, 3rd-party services, etc.).
  • CI/CD: If every point mentioned above is satisfied, achieving continuous integration and continuous delivery shouldn’t be difficult.

As far as I know, a complete platform does not yet exist, although you can get pretty close by using AWS Lambda and the Serverless Framework. I think all of the other serverless solutions will begin to keep up with the ideal expectations in 2017.

FaaS in the open-source world

Open-sourcing a project is a great way to let the community improve it and to get feedback as soon as possible (and ideally before the project is obsolete with respect to potential “competitors”).
There are three main open-source projects that allow you to build your own FaaS platform:

  • Apache OpenWhisk: Backed by IBM and recently incubated by Apache, OpenWhisk is the FaaS component of IBM Bluemix, although it does not support Kubernetes yet (see the GitHub issue or read more about it here).
  • IronFunctions: The open FaaS component of Iron.io. It supports both Docker and Kubernetes.
  • Funker: A small open-source project based on Docker Swarm, which already supports Node.js, Python, and Go.

I haven’t personally experimented with IronFunctions and Funker, but they both seem very promising. On the other hand, OpenWhisk is much more mature and comes with dev-friendly tools such as the Serverless Framework OpenWhisk Plugin.

FaaS on Kubernetes: FaaS frameworks for Kubernetes

A few FaaS solutions for Kubernetes have been announced and shared recently, thanks to several companies and individual contributors active in the Kubernetes community.
I explored three of these solutions during the webinar:

  • Kubeless: A proof-of-concept developed at Skippbox based on Apache Zookeeper and Apache Kafka. It supports both HTTP and PubSub as function triggers.
  • Funktion: Developed by fabric8 and backed by Red Hat. It seems to be well integrated with fabric8’s Developer Platform, and it supports multiple languages such as JavaScript, Python, Ruby, Java, etc.
  • Fission: As the newest of these solutions, it was designed to be extensible and fast, thanks to reduced cold starts. For now, it only supports HTTP triggers and Node.js/Python.

Interestingly, each of these are written in Go and offer a very similar approach from the function development point of view. Funktion and Fission adopted the very same function interface, which is also quite similar to AWS Lambda.

Pros & Cons of “on-premises” FaaS

Why would you decide to build your own FaaS platform? I think there are a few reasonable benefits, as well as strong limitations. As usual, it’s a tough trade-off between freedom, features, costs, and complexity. This holds with or without Kubernetes, in my opinion.
Here are the potential benefits of building your own FaaS platform:

  • You will achieve the same abstraction level for developers while using open-source technologies instead of proprietary black boxes.
  • You will have much more control over infrastructure and therefore the flexibility to cover more scenarios with fewer constraints.
  • Since you own the infrastructure, you may avoid a few non-functional limitations such as maximum timeouts, unmodifiable machine configurations, etc.
  • The overall solution might be cheaper and faster, although you should also take operational costs into consideration.

In terms of the cons, I see two. First of all, many of the nice-to-have features of FaaS are not currently available out of the public cloud, such as versioning, staging, environment variables, per-function monitoring and logging, advanced permissions and orchestration, and native triggers for databases, streams, object storage, etc. Secondly, the possibility to have more control over the underlying infrastructure may turn out to be a nightmare and not as cost effective as a public cloud solution, given the high operational complexity.

Faas on Kubernetes: Webinar Q&A

Here is the complete list of questions that we received during the webinar.

Q: What is the relationship between functions and APIs? I guess we’d want publicly facing APIs that forward to internal functions?

Functions don’t necessarily correspond to RESTful APIs. Some of your functions may respond to events in your system such as newly uploaded objects, updated database records, incoming streaming data, etc. In the case of APIs backed by functions, you need publicly facing endpoints that will forward requests to your function and return its results back as HTTP responses. This is exactly what most FaaS frameworks do, as well as PubSub mechanisms that allow you to implement more complex and event-driven logic.

Q: Apart from AWS Lambda, are there other FaaS platforms?

The most well known public FaaS platforms are AWS Lambda, Azure Functions, Google Cloud Functions, IBM Bluemix, OpenWhisk, Webtask.io, Iron.io, weblab.io, stdlib.com, UnitCluster, and many more still in preview or stealth mode.

Q: I understand that you probably don’t want to be biased, but for newbies, it would be nice to have a recommendation for which one to start with.

Although some of them have a corresponding commercial service, they are all open-source projects worth exploring. OpenWhisk seems to be the one that is the most mature and supported, even if it doesn’t support Kubernetes yet. Regarding the three Kubernetes frameworks I presented, I would start from Fission, which seems to be the most promising for now.

Q: Are you seeing an increase in the industry in terms of moving from PaaS toward FaaS?

Yes, definitely. FaaS and serverless are quickly changing how developers want to build quickly and efficiently. As with every technology out there, it’s not the perfect choice for every scenario, but it can drastically simplify your life and development workflow when you need to build microservices, RESTful APIs, and highly scalable event-driven applications.

Q: Which of the most mature frameworks make the debugging process easier?

I am not aware of any easy debugging strategy for FaaS at the moment. This is probably the hardest thing to do when you start having 10+ functions that react to different events and sources. AWS is actively working to solve the problem in-house with AWS X-Ray (still in preview). Other players such as the Serverless Framework allow you to fetch function logs and inspect them locally, which is more comfortable, but still not easy. Other services and startups – for example, IOpipe – are working hard on the same problem, which involves both debugging and monitoring.

Q: Cloud service, then microservice, then container, then function. So, what is the future of function?

That’s a very good question. I am not sure if we can achieve a more granular unit of delivery than individual functions. Indeed, FaaS might be the ultimate model from the development point of view, although there is plenty of margin for improvement, especially on the underlying layer. The future of FaaS – and development in general – might go from serverless to codeless altogether. That’s a future where everything has already been implemented by someone else, and you just have to put all of the pieces together. At that point, I’m afraid that machines will have already taken over! 🙂
Let us know what you think of FaaS and what you’ve built with it. You can watch the FaaS on Kubernetes webinar here. Don’t forget to watch our webinars if you want to learn more about Kubernetes and Docker.

Avatar

Written by

Alex Casalboni

Alex is a Software Engineer with a great passion for music and web technologies. He's experienced in web development and software design, with a particular focus on frontend and UX.


Related Posts

Chester Avey
Chester Avey
— November 7, 2019

Cloud Computing Solutions: 7 Trends for the Future

The world of cloud computing is in a state of flux. Not long ago, the cloud was considered an emerging technology, known only to IT specialists. Today it is a part of everyday life – 96% of businesses use the cloud in one form or another, and this number only looks set to grow. Whether ...

Read more
  • Cloud Computing
  • internet of everything
  • multi-cloud
  • Security
  • SEO
Avatar
Cloud Academy Team
— October 23, 2019

Which Certifications Should I Get?

As we mentioned in an earlier post, the old AWS slogan, “Cloud is the new normal” is indeed a reality today. Really, cloud has been the new normal for a while now and getting credentials has become an increasingly effective way to quickly showcase your abilities to recruiters and compan...

Read more
  • AWS
  • Azure
  • Certifications
  • Cloud Computing
  • Google Cloud Platform
Avatar
Walter Stone
— October 10, 2019

8 Surprising Ways Cloud Computing Is Changing Education

Cloud computing: Empowering the education industry Over the years, the education industry has come a long way. Teaching and learning are no longer confined to textbooks and classrooms and now reaches computers and mobile devices. Today, learners are always connected — whether they are ...

Read more
  • Cloud Computing
  • education industry
Avatar
Michael Sheehy
— August 19, 2019

What Exactly Is a Cloud Architect and How Do You Become One?

One of the buzzwords surrounding the cloud that I'm sure you've heard is "Cloud Architect." In this article, I will outline my understanding of what a cloud architect does and I'll analyze the skills and certifications necessary to become one. I will also list some of the types of jobs ...

Read more
  • AWS
  • Cloud Computing
Avatar
Andrew Larkin
— August 7, 2019

Disadvantages of Cloud Computing

If you want to deliver digital services of any kind, you’ll need to estimate all types of resources, not the least of which are CPU, memory, storage, and network connectivity. Which resources you choose for your delivery —  cloud-based or local — is up to you. But you’ll definitely want...

Read more
  • AWS
  • Azure
  • Cloud Computing
  • Google Cloud Platform
Avatar
Adam Hawkins
— June 12, 2019

What is Kubernetes? An Introductory Overview

In part 1 of my webinar series on Kubernetes, I introduced Kubernetes at a high level with hands-on demos aiming to answer the question, "What is Kubernetes?" After polling our audience, we found that most of the webinar attendees had never used Kubernetes before, or had only been expos...

Read more
  • Cloud Computing
  • Kubernetes
Avatar
Scott Huntington
— March 25, 2019

How Does Cloud Computing Work?

Whether you're looking to become a cloud engineer or you're a manager wanting to gain more knowledge, learn the basics of how cloud computing works. Are you wondering about how cloud computing actually works? We can help explain the basic principles behind this technology. Cloud comput...

Read more
  • Cloud Computing
Avatar
Guy Hummel
— March 4, 2019

What is Ansible?

What is Ansible? Ansible is an open-source IT automation engine, which can remove drudgery from your work life, and will also dramatically improve the scalability, consistency, and reliability of your IT environment. We'll start to explore how to automate repetitive system administratio...

Read more
  • Ansible
  • Cloud Computing
Avatar
Cloud Academy Team
— February 11, 2019

What is Puppet? Get Started With Our Course

When it comes to building and configuring IT infrastructure, especially across dozens or even thousands of servers, developers need tools that automate and streamline this process. Enter Puppet, one of the leading DevOps tools for automating delivery and operation of software no matter ...

Read more
  • Cloud Computing
  • Puppet
Avatar
Andrew Larkin
— January 15, 2019

2018 Was a Big Year for Content at Cloud Academy

As Head of Content at Cloud Academy I work closely with our customers and my domain leads to prioritize quarterly content plans that will achieve the best outcomes for our customers. We started 2018 with two content objectives: To show customer teams how to use Cloud Services to solv...

Read more
  • AWS
  • Azure
  • Cloud Computing
  • Google Cloud Platform
Avatar
Cloud Academy Team
— December 21, 2018

2019 Cloud Computing Predictions

2018 was a banner year in cloud computing, with Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP) all continuing to launch new and innovative services. We also saw growth among enterprises in the adoption of methodologies supporting the move toward cloud-native...

Read more
  • Cloud Computing
  • Cloud Predictions
Albert Qian
Albert Qian
— August 28, 2018

Introducing Assessment Cycles

Today, cloud technology platforms and best practices around them move faster than ever, resulting in a paradigm shift for how organizations onboard and train their employees. While assessing employee skills on an annual basis might have sufficed a decade ago, the reality is that organiz...

Read more
  • Cloud Computing
  • Product Feature
  • Skill Profiles