SlideShare une entreprise Scribd logo
1  sur  59
Télécharger pour lire hors ligne
Staying on Topic: OpenFaaS & Kafka
Richard Gee Core Contributor OpenFaaS Project
Docker Birmingham - May 2019
The Session
• OpenFaaS

• OpenFaaS Cloud

• Kafka Connector
• Get involved:
!" Tweet @rgee0 @openfaas
What’s in a name?
Serverless
is an
architectural pattern
Application Evolution
Monolith
Decreasing concern for infrastructure
Size&Complexity
Application Evolution
Monolith
Decreasing concern for infrastructure
MicroserviceMicroserviceMicroserviceMicroservice
Size&Complexity
Application Evolution
Monolith
Decreasing concern for infrastructure
Function
MicroserviceMicroserviceMicroserviceMicroservice
Size&Complexity
Application Evolution
Monolith
Decreasing concern for infrastructure
Function
MicroserviceMicroserviceMicroserviceMicroservice
Size&Complexity
Short-lived
Single-purpose
No state
Auto-scaling
OpenFaaS: Functions as a Service
• Started in Nov 2016
• Containers, Alexa, Swarm
OpenFaaS: Functions as a Service
• Started in Nov 2016
• Containers, Alexa, Swarm
OpenFaaS: Functions as a Service
• Started in Nov 2016
• Containers, Alexa, Swarm
• CNCF landscape
OpenFaaS: Functions as a Service
• Started in Nov 2016
• Containers, Alexa, Swarm
• CNCF landscape
OpenFaaS: Functions as a Service
• Started in Nov 2016
• Containers, Alexa, Swarm
• CNCF landscape
• Multiple Production users
OpenFaaS: Functions as a Service
• Started in Nov 2016
• Containers, Alexa, Swarm
• CNCF landscape
• Multiple Production users
• 2 InfoWorld Bossies##
OpenFaaS: Functions as a Service
• Started in Nov 2016
• Containers, Alexa, Swarm
• CNCF landscape
• Multiple Production users
• 2 InfoWorld Bossies##
• Ecosystem Partners
Our community & contributors
#TeamServerless
Growth of OpenFaaS 17k
Developer-
First
Operator-
Friendly
Community-
Centric
DRIVEN BY CORE VALUES
OpenFaaS: Serverless on your terms
Anywhere
Avoid lock-in through
the use of Docker.
Run on any public or
private cloud.
OpenFaaS: Serverless on your terms
Anywhere
Avoid lock-in through
the use of Docker.
Run on any public or
private cloud.
Any scale
Auto-scale with
demand and to
zero when idle.
OpenFaaS: Serverless on your terms
You decide the limits
Anywhere
Avoid lock-in through
the use of Docker.
Run on any public or
private cloud.
Any code
Build microservices
& functions in any
language. Legacy
code and binaries.
Any scale
Auto-scale with
demand and to
zero when idle.
Serverless 2.0
Serverless 2.0 contract
• HTTP/8080
• Docker / OCI image
• Stateless
• Immutable
*adopted by
OpenFaaS & Knative
/
High Level Architecture
API
Gateway
Provider
Func 1
NATS
Prometheus
CLI/Web/API
Func 2
AlertManager
Queue
Worker
Orchestrator
Templates
Create a function
$ faas new --lang php7 black-cat
provider:
name: openfaas
gateway: http://127.0.0.1:8080
functions:
black-cat:
lang: php7
handler: ./black-cat
image: rgee0/black-cat:latest
stack.yml
1.
php7
Template
Docker
Image
Create a function
public function handle($data) {
$res=UnirestRequest::get($data);
return $res->code . PHP_EOL;
}
Handler.php
composer.json
"require": {
"php": "^7.2",
"mashape/unirest-php": "3.*"
}
$ faas up
2.
Build
Push
Deploy } UP
$ faas new --lang php7 black-cat
1.
Demonstration
Get Started
Demo - What we saw
• Created a new PHP7 function
• faas up to Build, Push & Deploy locally
• Added a second function
• Portability - Deploying remotely
• Using the Function Store
• Function Auto-scaling
End Users & Case Studies
Case Study 1: Bullet-proof
Bulletproof are using OpenFaaS to
build an on demand and scalable
Vulnerability Scanning (VA) engine.

Using OpenFaaS allows us to use
compute resource efficiently yet
maintain the ability to grow to meet
customer scanning demands.
We also like the ability to use pure
docker containers to compose
multiple scanning tools with different
technologies into a single, coherent
interface. This has reduced the time
need to add new tools to the platform.
Case-study 1: BT Research, UK
• Production usage

• Heavily reliant

• Research platform &
internal tools

• Shrink-wrap into
products

• KPIs
Case Study 1:Case Study 1: BT Research, UK
Case Study 2: Vision Banco, Paraguay
- Digital Transformation

- OpenFaaS in production with
HomeServe

- Initial deployment with Swarm

- KubeCon talk @ Seattle

- Completely on-prem with
GitLab
Case Study 3: Parking Application
Swarm
OpenFaaS
Scheduler
Routing / TLS
FrontEnd
External State
Fully Immutable
Flexible / Extensible
Portable
CI/CD with GitLab
Fn Fn Fn Fn Fn Fn
Fn Fn Fn Fn Fn Fn
OpenFaaS Cloud
Focus on shipping functions without worrying
about the CI/CD pipeline or underlying
infrastructure
OpenFaaS Cloud is OpenFaaS, with
• Multi-user
• Personal dashboard & HTTPS
• CI/CD built-in (GitOps)
• Feedback via GitHub
• Free Community Cluster
• Self Hosted
High Level Flow
Func 1
git repoDevelop
Func 2
BuildKit
Github*
OpenFaaS
Cloud
Registry
OpenFaaS
Gateway
Conceptual workflow (CI/CD)
Workspace
stack.yml
dymo/handler.go
dymo/handler_test.go
GitHub
App
git
push
rgee0/dymo
OpenFaaS
Cloud
Package
Build
Deploy
https://rgee0.o6s.io/dymo
JSON
Encrypted secrets
secrets.yml
access_key=Ydx==
secret_key=E2Dvv==
access_key=1234
secret_key=abcd
Seal()
access_key=1234
Unseal() secret_key=abcd
Public Key
Private Key
Demonstration
OpenFaaS Cloud
GitHub Feedback
Dashboard
Kafka Connector
Trigger functions through Topics
13
● Communication
asynchronous
● Applications fully
decoupled
● No restriction on
schema, no shared
datastore
● Microservices
independent,
increased
resiliency
● Microservices state
still important,
persistent
ORDERING
INVOICING WAREHOUSE SHIPPING
LOGGING
MESSAGE QUEUE
Order
Placed
Order
Placed
Invoice
Generated
Order
Placed
Item
Found
Item
Found
Item
Shipped
Order
Placed
Item
Shipped
All
Events
Invoice
Generated
Mike Bywater - https://bit.ly/2K9XBTP
Kafka Connector
• Connector SDK
• Helm Chart
• Integrate with existing instances
• Function Annotations
• Consumer of multiple topics
Kafka Connector
Incoming
message
Topic: signup
msg:
{"userid":1013}
Lookup Functions
Use /system/functions
to BuildFunctionMap()
Invoke: 
/function/email-welcome
with:
{"userid":1013}
Kafka Connector
Topic Function
payment billing-audit
signup email-welcome
... ...
Builds
API Gateway
Function: billing-audit
Annotations:
topic: payment
Function: email-welcome
Annotations:
topic: signup
Function Map
Deploying
image: openfaas/kafka-connector:0.3.3
replicas: 1
gateway_url: http://gateway.openfaas:8080
topics: faas-request
print_response: true
print_response_body: false
broker_host: kafka
basic_auth: true
$ helm upgrade kafka-connector 
openfaas/kafka-connector 
—-install 
—-namespace openfaas
$ helm upgrade kafka-connector 
openfaas/kafka-connector 
—install 
--namespace openfaas 
--set image=rgee0/kafka-connector:0.4.0 
--set topics=“cats,not-cats" 
--set print_response_body=true
Cat Facts
Kafka
Topic: not-cats
Topic:
cats
not-catsTopic: cats
  cat-sifter   inception
 notify-slack post-tweet
 db-stasher
{
"url":
"https://an.image.com/rainbow.jpg",
"inferences": [
{ "score": 0.99434, "name": "rod" },
{ "score": 0.00024, "name": "jane" },
{ "score": 0.00006, "name": "freddy" }
],
"category": "not-cats"
}
 post-tweet  notify-slack
Cat Facts
Kafka
Topic: not-cats
Topic:
cats
not-catsTopic: cats
  cat-sifter   inception
 notify-slack post-tweet
 db-stasher
What about OpenFaaS Cloud?
Cat Facts
  pic-count
OpenFaaS Cloud
Kafka
Topic: not-cats
Topic:
cats
not-catsTopic: cats
  cat-sifter   inception
 notify-slack post-tweet
 db-stasher
Demo - What we saw
• OpenFaaS on Digital Ocean DOKS
• Kafka Connector & Annotated Functions
• Multiple Topics -> Function -> DB
• Voice Service
• Alexa Skill
• OpenFaaS Cloud Function
Wrapping Up
OpenFaaS:
Serverless Functions Made Simple
OpenFaaS Cloud:
Further reduce friction
Kafka Connector:
Connect Kafka topics to OpenFaaS Functions
Integrate your existing tools & applications
Get Involved
Join Slack:
https://docs.openfaas.com/community
Try the Workshop:
https://github.com/openfaas/workshop
*Instructor led option available
OpenFaaS Cloud Community Cluster:
https://forms.gle/8e6ZXJKMcDHpV6Xu6
Resources
Docs: https://docs.openfaas.com
Blog: https://www.openfaas.com/blog
Follow on Twitter: @OpenFaaS
Kafka Connector:
https://github.com/openfaas/faas-netes
Try Digital Ocean Marketplace:
https://m.do.co/c/2962aa9e56a1
Support OpenFaaS
Sponsor the project:
https://www.openfaas.com/donate/
Donate using Open Collective:
https://opencollective.com/openfaas
Donate using LF Community Bridge:
https://bit.ly/2V8jasf
@rgee0
Thank You!
www.openfaas.com

Contenu connexe

Tendances

Tendances (20)

Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
 
Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flow
 
Exciting New Alfresco REST APIs
Exciting New Alfresco REST APIsExciting New Alfresco REST APIs
Exciting New Alfresco REST APIs
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
 
Netflix Architecture Tutorial at Gluecon
Netflix Architecture Tutorial at GlueconNetflix Architecture Tutorial at Gluecon
Netflix Architecture Tutorial at Gluecon
 
Git 101
Git 101Git 101
Git 101
 
Lifecycle of a pod
Lifecycle of a podLifecycle of a pod
Lifecycle of a pod
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Do we need SOLID principles during software development?
Do we need SOLID principles during software development?
 
Cruise Control: Effortless management of Kafka clusters
Cruise Control: Effortless management of Kafka clustersCruise Control: Effortless management of Kafka clusters
Cruise Control: Effortless management of Kafka clusters
 
A Deep Dive into Kafka Controller
A Deep Dive into Kafka ControllerA Deep Dive into Kafka Controller
A Deep Dive into Kafka Controller
 
Running Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native ImagesRunning Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native Images
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
GitHub 실습 교육
GitHub 실습 교육GitHub 실습 교육
GitHub 실습 교육
 

Similaire à Staying on Topic - Invoke OpenFaaS functions with Kafka

Similaire à Staying on Topic - Invoke OpenFaaS functions with Kafka (20)

Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
 
Docker and serverless Randstad Jan 2019: OpenFaaS Serverless: when functions ...
Docker and serverless Randstad Jan 2019: OpenFaaS Serverless: when functions ...Docker and serverless Randstad Jan 2019: OpenFaaS Serverless: when functions ...
Docker and serverless Randstad Jan 2019: OpenFaaS Serverless: when functions ...
 
OpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - MilanOpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - Milan
 
OpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesOpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetes
 
OpenFaaS serverless framework for Docker and Kubernetes - London
OpenFaaS serverless framework for Docker and Kubernetes - LondonOpenFaaS serverless framework for Docker and Kubernetes - London
OpenFaaS serverless framework for Docker and Kubernetes - London
 
OpenFaaS 2019 Project Update
OpenFaaS 2019 Project UpdateOpenFaaS 2019 Project Update
OpenFaaS 2019 Project Update
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
 
The Big Cloud native FaaS Lebowski
The Big Cloud native FaaS Lebowski The Big Cloud native FaaS Lebowski
The Big Cloud native FaaS Lebowski
 
betterCode Workshop: Effizientes DevOps-Tooling mit Go
betterCode Workshop:  Effizientes DevOps-Tooling mit GobetterCode Workshop:  Effizientes DevOps-Tooling mit Go
betterCode Workshop: Effizientes DevOps-Tooling mit Go
 
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhereOpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
 
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
OpenFaaS - zero serverless in 60 seconds anywhere with case-studiesOpenFaaS - zero serverless in 60 seconds anywhere with case-studies
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
 
Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless Computing
 
GitOps meets Serverless
GitOps meets ServerlessGitOps meets Serverless
GitOps meets Serverless
 
Building production-quality apps with Node.js
Building production-quality apps with Node.jsBuilding production-quality apps with Node.js
Building production-quality apps with Node.js
 
Zero to Serverless - OpenFaaS at the Open Source Summit
Zero to Serverless - OpenFaaS at the Open Source SummitZero to Serverless - OpenFaaS at the Open Source Summit
Zero to Serverless - OpenFaaS at the Open Source Summit
 
Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
Zero to Serverless in 60s - Anywhere
Zero to Serverless in 60s - AnywhereZero to Serverless in 60s - Anywhere
Zero to Serverless in 60s - Anywhere
 
Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Staying on Topic - Invoke OpenFaaS functions with Kafka