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

Hello world

To start off with we are going to look at deploying two very simple hello world functions. The first simply prints Hello World! and the second takes an input and then displays it back to you.

The basic example

First of all, we need our function. The static hello-world function requires the following three lines of Python code:

import json
def handler():
return "Hello World!"

Place the preceding code, which is also available in the Chapter04/hello-world folder of the GitHub repository that accompanies this book, in a file called hello.py.

Now we have our function we can deploy it into the default namespace by running the following command:

$ kubeless function deploy hello \
--from-file hello.py
--handler...
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