Zero to Serverless in 60s - Anywhere
Serverless Functions Made Simple
KUBECON
Alex Ellis - Project Lead And Author
@alexellisuk
What is Serverless?
MicroserviceMicroserviceMicroservice
Monolith
Microservice
Function
Serverless	evolu*on
OpenFaaS
DRIVING FACTORS
“Alexa, how’s
the weather?”
{ “intent”:
“FindWeather” }
{ “speech”:
“It’s 70 degrees” }
Lambda
Function
“Alexa, how’s
the weather?”
{ “intent”:
“FindWeather” }
{ “speech”:
“It’s 70 degrees” }
+
What are serverless use-cases?
ANYTHING - WINDOWS/LINUX
Image/Video
conversion
Machine
Learning
Mobile Back-
ends / IoT
HTTP API /
Integrations
Chat Bots
Batch Jobs
How did OpenFaaS come about?
STORY SO FAR
• “Lambda but with containers for Alexa”
• Dockercon Cool Hacks - “push Docker beyond what it was designed to do”
• Since May
• Top trending Open Source project overall
• > 8k stars
• Industry Award
• Production users
• Kubernetes, Nomad, DC/OS, Cattle
Commits: 876, Forks: 372 Stars: 6589
OpenFaaS top contributors and influencers
You..
1.3k commits, 65+ contributors, 533 forks
Building a Twitter bot
Comes in one flavor: Cloud Native
API Gateway Function Watchdog
Prometheus Swarm Kubernetes
HTTP
body
stdinrequest
stdoutresponse
“python3

main.py”
headers
body
headers
Forked process
Function watchdog
OpenFaaS values
Portable
Developer-
First
Unsurprising
UNIX-like
Operator-
Friendly
Community-
Centric
Open
Platform
Developer
Love
CLI & UI
Cloud Native
Native Kubernetes support
Gateway faas-netes
UI
CLI
Web
Func 1
Func 1
Func 2
faas-dcos
faas-nomad
CLOUD NATIVE
Deployed in 60 seconds
Gateway BuildVM
DeployVM
MySQL
Moby
Store
Add2Cart
.ISO
Introducing Derek
How do I write a function?
WRITE A HANDLER
def handler(req):
r = requests.get(req)
print(r.status_code)
handler.py
requirements.txt
Python
Template
Docker
Image
requests
$ faas new --lang python dockercon
Container Registry
How do I arrange functions?
provider:
name: faas
url-ping:
lang: python
handler: ./sample/url-ping
image: of/url-ping
environment:
http_proxy: http://corp1.com
notify-slack:
lang: python
handler: ./sample/notify-slack
image: of/notify-slack
$ faas build
$ faas push
$ faas deploy
YAML STACK
Synchronous invocation
IMMEDIATE RESULT
HTTP
Gateway Func: resizer
HTTP

200
Resize

Image
Asynchronous invocation
DEFERRED EXECUTION
Gateway Func: resizer
HTTP

200
http://x.y.z
X-Callback-Url:	
hDp://x.y.z
X-Callback-Url
Resize

Image
Queue etc
Building a Serverless Twitter bot
@COLORISEBOT
Gateway Colorise
Tweet-pic
Minio
Tweet-listener
Sync
Async
Cookie-cut existing functions
EXAMPLE WITH PATREON FOR BACKERS
• Receive web hook
• Verify origin (HMAC)
• Tweet using API token
Don’t take my word for it
USERS FUNCTION PROVIDERS & INTEGRATIONS
What’s next?
• Coming soon
• Function Store (launched)
• Derek as a public GitHub app
• Documentation site
• Technical
• Cloud events - AWS/EventGrid connector
• Multi-tenancy
• OpenTracing
• Scaling to zero 0/1
Commits: 876, Forks: 372 Stars: 6589
Thank you!
Follow @openfaas
www.openfaas.com
"One of the most impressive
things I saw during DockerCon
was the OpenFaaS project…


I was blown away by the
simplicity of OpenFaaS”
- CTO Advisor 19 Oct 2017
Commits: 876, Forks: 372 Stars: 6589
Find out more www.openfaas.com

OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere