Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kubernetes for Serverless Applications

You're reading from   Kubernetes for Serverless Applications Implement FaaS by effectively deploying, managing, monitoring, and orchestrating serverless applications using Kubernetes

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781788620376
Length 318 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Russ McKendrick Russ McKendrick
Author Profile Icon Russ McKendrick
Russ McKendrick
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. The Serverless Landscape FREE CHAPTER 2. An Introduction to Kubernetes 3. Installing Kubernetes Locally 4. Introducing Kubeless Functioning 5. Using Funktion for Serverless Applications 6. Installing Kubernetes in the Cloud 7. Apache OpenWhisk and Kubernetes 8. Launching Applications Using Fission 9. Looking at OpenFaaS 10. Serverless Considerations 11. Running Serverless Workloads 12. Other Books You May Enjoy

Some more examples

Before we finish off the chapter, let's look at some more example code running in Fission, starting with a weather checker.

Weather

In the /Chapter08/weather/ folder of the repository, you will find weather.js. This is a simple Node.js function that queries the Yahoo weather API to return the current weather for a given location:

'use strict';

const rp = require('request-promise-native');

module.exports = async function (context) {
const stringBody = JSON.stringify(context.request.body);
const body = JSON.parse(stringBody);
const location = body.location;

if (!location) {
return {
status: 400,
body: {
text: 'You must provide...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image