SlideShare a Scribd company logo
1 of 38
© Copyright 2019 Pivotal Software, Inc. All rights Reserved.
Developing Serverless
Applications on Kubernetes with
Knative
Brian McClain
@BrianMMcClain
Bryan Friedman
@bryanfriedman
Cover w/ Image
Agenda
■ What is Knative?
■ Example Application
○ Walkthrough on Knative
○ Demo
■ Project riff
■ Q+A
Knative: A platform for developers to
build and run serverless applications
atop Kubernetes
Eventing
How your code is
triggered by events
● Apps and functions consume
and publish event streams
● Multiple event sources available
● Encourages asynchronous,
loosely coupled architecture
Build
How your code is built and
packaged as a container
● Pluggable model to build
containers from source code
● Build in-cloud or on-cluster
● Push image to registry
● Templates available
(e.g. Buildpacks)
Serving
How your code receives requests
and scales with them
● Request-driven compute runtime
● Scale-to-zero / scale out per load
● Deploy from container registry
● Multiple revisions of same app
● Route traffic across revisions
DETAILS DETAILS DETAILS
Knative Components
Eventing
How your code is
triggered by events
● Apps and functions consume
and publish event streams
● Multiple event sources available
● Encourages asynchronous,
loosely coupled architecture
Serving
How your code receives requests
and scales with them
● Request-driven compute runtime
● Scale-to-zero / scale out per load
● Deploy from container registry
● Multiple revisions of same app
● Route traffic across revisions
DETAILS DETAILS
Knative Components
https://pivotal.io/ebooks
Available Now
The Example Application
Example Application - Earthquake Visualization
PSQL
Frontend
Earthquake
Event
Source
Earthquake
USGS
Event
Feed
Example Application - High-Level Architecture
Geocoder
Function
PSQL
Geocoder
FunctionFrontend
Earthquake
Event
Source
Earthquake
USGS
Event
Feed
Example Application - High-Level Architecture + Flood Source
Flood USGS
Event
Feed
Flood
Event
Source
Event Format
{
id: 123456
type: "flood",
time: "01:30:00-05:00",
lat: "41.5061",
long: "-81.6995",
measure: 3.38,
metadata: {
station: ...
}
}
Example Application - Earthquake + Flood Visualization
Walkthrough on Knative
Serving
Flexible scaling and routing to your application.
● Automatically deploy containers and configure routing
● Automatically scale up and down, including scale-to-zero
● Point-in-time snapshots of deployments allows multiple versions of
applications at once
● Easy rollbacks, blue-green deployments, partial load testing,
(percentage-based routing), etc.
{app-name}.{namespace}.{custom-domain}
Serving - Deployment
n-1
n
earthquake-demo.default.dev.gswkbook.com
docker.io/gswk/earthquake-demo-frontend:flood
© 2019 PIVOTAL SOFTWARE, INC. All Rights Reserved. Confidential & Provided Under
NDA —Do Not Distribute. Forwarding this document outside your organization is
prohibited.
Cloud Native Buildpacks (CNB) Bring Developer Productivity to K8s
Pluggable, modular tools that
translate source code into
OCI images.
● Portability via the OCI standard
● Greater modularity
● Faster builds
● Run in local dev environments for
faster troubleshooting
● Developed in partnership between
Pivotal and Heroku
● CNCF project
Pivotal Build Service System
Build and package code on-cluster.
● Builds are run completely within Kubernetes
● Code is pulled from git at build time
● Uses Cloud Native Buildpacks
● Packaged as container images; pushed to a registry of your choice
● Underlying CRDs for Build Service to be open source soon!
Build
Code
Container
Image
docker.io/gswk/earthquake-demo-frontend:flood
https://github.com/gswk/earthquake-demo-frontend.git
Build
Service
System
Demo
Eventing
Robust eventing support that abstracts away the messaging layer.
● Easy for developers to consume events - No messaging-specific
code
● Messaging layer is abstracted from the developer and pluggable
for the operator
● Brokers provide a place to send events, Triggers direct them
where to go
● Pluggable, Customizable Event Sources
Example Event Sources
Cron Job. Produce events on a specified Cron schedule
GitHub. Events happening in a GitHub repository/organization (commit,
new pull request, etc) trigger your function
Google Cloud Storage. Invokes your function when files are uploaded
or changed in a specified bucket
AWS SQS. Messages on SQS are forwarded to your function
Custom Event Sources
Event Sources are pluggable and not tightly bundled to Knative
● Community-developed event sources are installed by applying a
YAML file
● ContainerSource makes it easy to build your own event source
○ Package your event emitter as a container, Knative gives a
URI to POST to
Eventing - Direct Delivery
Event
Source
POST / http://geocoder.default.dev.gswkbook.com
{
id: 123456
type: "flood",
time: "01:30:00-
05:00",
lat: "41.5061",
long: "-81.6995",
measure: 3.38,
metadata: {
station: ...
}
Eventing - Broker/Trigger
Event
Source
App
Trigger
Broker
Filter
Eventing - Broker/Trigger
Event
Source
App
Trigger
Broker
Filter
Trigger
Filter
App
Eventing - Broker/Trigger
Event
Source
App
Trigger
Broker
Filter
Trigger
Filter
App
Demo
Example Application - Architecture
Geocoder
Function
Code
Frontend
Code
HTTP
1
2
3
4
Frontend
Geocoder
Function
USGS
Earthquake
Event
Feed
PSQL
Earthquake
Event
Source
Example Application - Architecture with New Event Source
Geocoder
Function
Code
Frontend
Code
HTTP
1
2
3
4
Frontend
Geocoder
Function
USGS
Earthquake
Event
Feed
PSQL
Earthquake
Event
Source
Flood
Event
Source
USGS
Flood
Event
Feed
Frontend
Project riff
Project riff
Integrated Build Service. Bundled with Pivotal’s Build Service to
quickly and securely build container images from source.
riff CLI. Make it easy to quickly deploy to Knative. Removes the need to
manage YAML.
Invokers. Allows developers to focus on their functions, invokers will
handle setting up the webserver and running your code
Project riff - Without Invokers
const express = require("express");
const bodyParser = require('body-parser')
const app = express();
app.use(bodyParser.text({type: "*/*"}));
app.post("/", function(req, res) {
res.send("Hello, " + req.body + "!");
});
const port = process.env.PORT || 8080;
app.listen(port, function() {
console.log("Server started on port", port);
});
Project riff - With Invokers
module.exports = x => "Hello, " + x + "!";
Project riff - Deploying Functions
https://pivotal.io/ebooks
Available Now
@BrianMMcClain
@bryanfriedman
github.com/gswk/earthquake-demo
Questions?
Q+A
Transforming How The World Builds Software
© Copyright 2019 Pivotal Software, Inc. All rights Reserved.

More Related Content

What's hot

What's hot (20)

Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)
 
Google Cloud Platform and Kubernetes
Google Cloud Platform and KubernetesGoogle Cloud Platform and Kubernetes
Google Cloud Platform and Kubernetes
 
Open Container Technologies and OpenStack - Sorting Through Kubernetes, the O...
Open Container Technologies and OpenStack - Sorting Through Kubernetes, the O...Open Container Technologies and OpenStack - Sorting Through Kubernetes, the O...
Open Container Technologies and OpenStack - Sorting Through Kubernetes, the O...
 
Knative Intro
Knative IntroKnative Intro
Knative Intro
 
Automate Workflows With The Open-source Cloud-native Tool Boomerang Flow
Automate Workflows With The Open-source Cloud-native Tool Boomerang FlowAutomate Workflows With The Open-source Cloud-native Tool Boomerang Flow
Automate Workflows With The Open-source Cloud-native Tool Boomerang Flow
 
Serverless with Knative - Mete Atamel (Google)
Serverless with Knative - Mete Atamel (Google)Serverless with Knative - Mete Atamel (Google)
Serverless with Knative - Mete Atamel (Google)
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKE
 
Knative And Pivotal Function As a Service
Knative And Pivotal Function As a ServiceKnative And Pivotal Function As a Service
Knative And Pivotal Function As a Service
 
Gentle introduction to containers and kubernetes
Gentle introduction to containers and kubernetesGentle introduction to containers and kubernetes
Gentle introduction to containers and kubernetes
 
The what, why and how of knative
The what, why and how of knativeThe what, why and how of knative
The what, why and how of knative
 
Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)
 
Cloud spanner architecture and use cases
Cloud spanner architecture and use casesCloud spanner architecture and use cases
Cloud spanner architecture and use cases
 
Take the Fastest Path to Node.Js Application Development with Bitnami & AWS L...
Take the Fastest Path to Node.Js Application Development with Bitnami & AWS L...Take the Fastest Path to Node.Js Application Development with Bitnami & AWS L...
Take the Fastest Path to Node.Js Application Development with Bitnami & AWS L...
 
Digital Transformation with Docker, Cloud, and DevOps: How JCPenney Handles B...
Digital Transformation with Docker, Cloud, and DevOps: How JCPenney Handles B...Digital Transformation with Docker, Cloud, and DevOps: How JCPenney Handles B...
Digital Transformation with Docker, Cloud, and DevOps: How JCPenney Handles B...
 
Tackle Containerization Advisor (TCA) for Legacy Applications
Tackle Containerization Advisor (TCA) for Legacy ApplicationsTackle Containerization Advisor (TCA) for Legacy Applications
Tackle Containerization Advisor (TCA) for Legacy Applications
 
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech TalkOperatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
 
Building Your NoSQL Ship: How an Enterprise Transitioned from a RDBMS to NoSQ...
Building Your NoSQL Ship: How an Enterprise Transitioned from a RDBMS to NoSQ...Building Your NoSQL Ship: How an Enterprise Transitioned from a RDBMS to NoSQ...
Building Your NoSQL Ship: How an Enterprise Transitioned from a RDBMS to NoSQ...
 
Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
CI and CD with Spinnaker
CI and CD with SpinnakerCI and CD with Spinnaker
CI and CD with Spinnaker
 

Similar to Developing Serverless Applications on Kubernetes with Knative - OSCON 2019

Developing Serverless Applications on Kubernetes with Knative
Developing Serverless Applications on Kubernetes with KnativeDeveloping Serverless Applications on Kubernetes with Knative
Developing Serverless Applications on Kubernetes with Knative
VMware Tanzu
 

Similar to Developing Serverless Applications on Kubernetes with Knative - OSCON 2019 (20)

Developing Serverless Applications on Kubernetes with Knative
Developing Serverless Applications on Kubernetes with KnativeDeveloping Serverless Applications on Kubernetes with Knative
Developing Serverless Applications on Kubernetes with Knative
 
Making Service Deployments to AWS a breeze with Nova
Making Service Deployments to AWS a breeze with NovaMaking Service Deployments to AWS a breeze with Nova
Making Service Deployments to AWS a breeze with Nova
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
 
SpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSASpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSA
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your way
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
Microservices with kubernetes @190316
Microservices with kubernetes @190316Microservices with kubernetes @190316
Microservices with kubernetes @190316
 
CI/CD on Google Cloud Platform
CI/CD on Google Cloud PlatformCI/CD on Google Cloud Platform
CI/CD on Google Cloud Platform
 
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> KubernetesJJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open Source
 
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesGIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
 
Cloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
Cloud Native Islamabad - Getting Closer to Continuous Delivery with KnativeCloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
Cloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
 
Serverless Apps with Open Whisk
Serverless Apps with Open Whisk Serverless Apps with Open Whisk
Serverless Apps with Open Whisk
 
Serverless apps with OpenWhisk
Serverless apps with OpenWhiskServerless apps with OpenWhisk
Serverless apps with OpenWhisk
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifest
 
OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture
 
Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...
Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...
Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...
 
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
 
AWS in Practice
AWS in PracticeAWS in Practice
AWS in Practice
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Developing Serverless Applications on Kubernetes with Knative - OSCON 2019