Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
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 2. An Introduction to Kubernetes FREE CHAPTER 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

Deploying a simple function

Now that we have our Funktion deployment up-and-running, we can look at deploying a really simple hello world example. In the /Chapter05/hello-world/src folder in the GitHub repository that supports this book, you will find a file called hello.js. This file contains the following code:

module.exports = function(context, callback) {
var name = context.request.query.name || context.request.body || "World";
callback(200, "Hello " + name + "!!");
};

Running the following command in the /Chapter05/hello-world/ folder will create our first function using the preceding code:

$ funktion create fn -f src/hello.js

The output should look like this:

As you can see from the Terminal output, this has created a function called hello. Now, we have function running the following command:

$ funktion get function

This should return some...

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 €18.99/month. Cancel anytime