Kubernetes

ta-ching chen

4 minute read

Introduction

At Part 2, we knew what’s real payload was passed to function and how to create a serverless guesbook. In the last post, we will go through the final bank sample and know how to deploy a application to different fission clusters.

A Serverless Bank Application in Golang (Sample)

In this section, we use a more complex bank sample to demonstrate how to use AJAX interacts with fission functions.

Fission Bank Diagram

ta-ching chen

6 minute read

Introduction

Part 1 we talked about the advantage of adopting fission as serverless framework on kubernetes, basic concept of around fission core and how to create a simple HelloWorld example with fission.

In this post we’ll dive deeper to see what’s the payload of a HTTP request being passed to user function and learn how to create a guestbook application consists with REST functions in Golang.

How Fission maps HTTP requests to user function

Before we diving into code, we first need to understand what exactly happened inside Fission. Here is a brief diagram describes how requests being sent to function inside Kubernetes cluster.

router maps req to fn

The requests will first come to the router and it checks whether the destination URL and HTTP method are registered by http trigger. Once both are matched, router will then proxy request to the function pod (a pod specialized with function pointed by http trigger) to get response from it; reject, otherwise.