Skip to content

Latest commit

 

History

History

guestbook

fonk-apps.io Guestbook

Guestbook: The Hello World of K8S

Guestbook is in many ways the 'hello world' of the K8S community and makes for a good first FONK example because it is so familiar to people. The architecture of the K8S Guestbook is as follows:

K8S Guestbook Architecture

By default, three pods get deployed to handle front end traffic, two for database reads, and one for database writes.

Guestbook as a Serverless Application

A FONK approach to Guestbook uses the following components:

FONK Guestbook Architecture

Files for this set of examples follows this structure with the front end HTML, .js, and Minio start up/configuration instructions in the frontend folder. No additional configuration is required of the Mongo database beyond what you have already done during FONK deployment.

Guestbook has two basic operations: Create and List. Upon initial page load, the JavaScript in the frontend makes a REST API call to get the list of entries already in the database. When a user enters a new message in the UI, the frontend makes a REST API call to create a new entry before then making a second call to get the list of entries now in the database.

Each FaaS runtime/language combination implements Create and List, so start there. Then follow the instructions in frontend to put a UI on top of the Create and List REST API calls you created with the FaaS runtime/language combination you chose.

Current status

FONK Guestbook Status

See a missing combination? Feel free to contribute by submitting a Pull Request with your implementation of that combination so that others can learn from your experience!