riffing on Knative
Scott Andrews
@scothis
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Safe Harbor Statement
The following is intended to outline the general direction of Pivotal's offerings. It is intended for
information purposes only and may not be incorporated into any contract. Any information
regarding pre-release of Pivotal offerings, future updates or other planned modifications is subject
to ongoing evaluation by Pivotal and is subject to change. This information is provided without
warranty or any kind, express or implied, and is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing decisions regarding Pivotal's
offerings. These purchasing decisions should only be based on features currently available. The
development, release, and timing of any features or functionality described for Pivotal's offerings in
this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward
looking information in this presentation.
2
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Disclaimer
everything is alpha
Have fun(ctions), but not in production
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Demo driven talk
• Kubernetes primer
• Serverless Kubernetes with Knative
• Building and deploying a riff Function from source
• Java
• Node.js
• commands
• Invoking a riff Function
• command driven functions
• event driven functions
Overview
4
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Tools we’ll use
• riff - riff is for functions
https://github.com/projectriff/riff/releases
• kubectl - Kubernetes CLI
https://kubernetes.io/docs/tasks/tools/install-kubectl/
• kail - kubernetes tail
https://github.com/boz/kail
• watch - execute a program periodically, showing output fullscreen
https://gitlab.com/procps-ng/procps
5

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Demo: Using k8s
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
What is riff
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Knative
Kubernetes-based platform to build, deploy,
and manage modern serverless workloads
Three core components:
• Build - Source-to-container build orchestration
• Serving - Request-driven compute that can scale to zero
• Eventing - Management and delivery of events
100% open source. Created by Google with contributions from Pivotal and others
8

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/ 9
BuildTemplate
Source
Channel
Build
Knative Custom Resource Definitions
Subscription
refers to
refers to
creates and
registers
instance of
Eventing
Serving
Build
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
riff is for functions
• event driven Function as a Service
• opinionated experience built atop Knative, Kubernetes and Istio
• functions practice Inversion of Control
• no servers, ports or messaging protocols, just your logic
• pick your language runtime:
• Java/Spring
• JavaScript/Node
• executable commands
• more from the community
1
0

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
riff on Knative
Community-driven
ecosystem of
Sources,
Channels,
Functions,
Invokers,
BuildTemplates,
etc.
Kubernetes
BuildTemplates
Channels
CLI
Invokers
CLI
Invokers
Build
Topics
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Installing riff (and Knative)
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Creating a Kubernetes cluster
13
# https://projectriff.io/docs/getting-started/gke/
# create cluster
gcloud container clusters create $CLUSTER_NAME 
--cluster-version=latest --machine-type=n1-standard-4 
--enable-autoscaling --min-nodes=1 --max-nodes=3 --num-nodes=3 
--enable-autorepair 
--scopes=service-control,service-management,compute-rw,storage-ro,cloud-platform,logging-
write,monitoring-write,pubsub,datastore
# grant yourself cluster-admin
kubectl create clusterrolebinding cluster-admin-binding 
--clusterrole=cluster-admin 
--user=$(gcloud config get-value core/account)
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Install riff
14
# https://projectriff.io/docs/getting-started/gke/
# once per cluster
riff system install
# once per namespace
riff namespace init $NAMESPACE --gcr $PATH_TO_GCR_CREDENTIALS
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Install riff
...and dependencies including:
• Istio
• Knative Build
• Knative Serving
• Knative Eventing
• In Memory Channel Provisioner
• Kafka, Cloud Pub/Sub, NATSS are also available, but not installed
• riff BuildTemplate - convert source to riff Function container images
• credentials to push builds to an image registry
1
5

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Demo: Exploring Knative
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/ 17
BuildTemplate
Source
Channel
Build
Knative Custom Resource Definitions
Subscription
refers to
refers to
creates and
registers
instance of
Eventing
Serving
Build
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
riff Functions
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
a riff Java Function
19
// https://github.com/projectriff-samples/fats-uppercase-java
package functions;
import java.util.function.Function;
public class Upper implements Function<String, String> {
public String apply(String s) {
return s.toUpperCase();
}
}
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
a riff JavaScript Function
2
0
// https://github.com/projectriff-samples/fats-uppercase-node
module.exports = s => s.toUpperCase();
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
a riff Command Function
21
# https://github.com/projectriff-samples/fats-uppercase-command
#!/bin/sh
tr '[a-z]' '[A-Z]'
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Demo: riff Functions
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Deploy a riff Function
2
3
riff function create square 
--git-repo https://github.com/projectriff-samples/node-square 
--artifact square.js 
--verbose
kail -l riff.projectriff.io/function=square -c user-container
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke a riff Function
2
4
riff service invoke square --json -- 
-w 'n' 
-d 7
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Let’s create another function
2
5
riff function create greet 
--git-repo https://github.com/projectriff-samples/command-hello 
--artifact greet.sh
riff service invoke greet --text -- 
-w 'n' 
-d "Washington"
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Demo: Local Functions
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Iterating quickly (in development)
2
7
riff function local run 
--local-path ./uppercase
curl localhost:8080 
-H 'Content-Type: text/plain' 
-w 'n' 
-d 'shhh!'
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Run on cluster from local source
2
8
riff function create uppercase 
--local-path ./uppercase 
--verbose
riff service invoke uppercase --text -- 
-w 'n' 
-d 'shhh!'
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Demo: Event Driven Functions
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke a riff Function with events
3
0
riff channel create numbers
riff channel create squares
riff subscription create 
--channel numbers 
--subscriber square 
--reply squares
riff service create correlator 
--image scothis/correlator:s1tour
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke a riff Function with events
31
correlator
numbers
squaressquare
riff invoke /numbers
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Demo: Function Chaining
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke a riff Function with events
3
3
riff service invoke correlator /s1tour/numbers --json -- 
-w 'n' 
-v 
-d 7
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke the riff Function with events
3
4
correlator
numbers
replies
squaressquaregreet
riff invoke /numbers
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Let’s chain our functions
3
5
riff channel create replies
riff subscription create 
--channel squares 
--subscriber greet 
--reply replies
riff subscription create 
--channel replies 
--subscriber correlator
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke a riff Function with events
3
6
riff service invoke correlator /s1tour/numbers --json -- 
-H "Knative-Blocking-Request: true" 
-w 'n' 
-d 7
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke the riff Function with events
3
7
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke the riff Function with events
3
8
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke the riff Function with events
3
9
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke the riff Function with events
4
0
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke the riff Function with events
41
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Invoke the riff Function with events
4
2
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Other patterns are possible
4
3
correlator
numbers
replies
squaressquaregreet
riff invoke /numbers
dead-beef-00
GET /dead-beef-00
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
There's more we didn't have time to show...
4
4
• alternate Eventing Channels
• Kafka
• NATSS
• Google Cloud PubSub
• Eventing Sources
• Cloud Events
• alternate BuildTemplates
• Buildah
• jib
• kaniko
• deploying Knative from source
• Istio
• public DNS
• Autoscaler tuning
• monitoring
• Grafana
• Prometheus
• Zipkin
You can learn more at
https://www.knative.dev
Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license:
http://creativecommons.org/licenses/by-nc/3.0/
Free eBook
http://bit.ly/getting-started-with-knative
Hot off the press
> join us at projectriff.io
@projectriff

More Related Content

PDF
Containers Were Never Your End State
PDF
Automation and Culture Changes for 40M Subscriber Platform Operation
PDF
Running Java Applications on Cloud Foundry
PDF
Running Spring Boot Applications as GraalVM Native Images
PDF
Kubernetes for the Spring Developer
PDF
Secrets of Successful Digital Transformers
PDF
JHipster for Spring Boot webinar
PDF
Serverless Spring
Containers Were Never Your End State
Automation and Culture Changes for 40M Subscriber Platform Operation
Running Java Applications on Cloud Foundry
Running Spring Boot Applications as GraalVM Native Images
Kubernetes for the Spring Developer
Secrets of Successful Digital Transformers
JHipster for Spring Boot webinar
Serverless Spring

What's hot (20)

PDF
Reactor 3.0, a reactive foundation for java 8 and Spring
PPTX
Adobe CQ at LinkedIn Meetup February 2014
PDF
Spring Tools 4 - Eclipse and Beyond
PDF
Documenting RESTful APIs with Spring REST Docs
PPTX
What's New in Spring for Apache Kafka 2.0
PDF
Cloud Foundry Services on PKS with No Extra Code, "We Bosh So You Don’t Have ...
PDF
K8s at Scale in the Enterprise: Self-Service Through the View of Personas
PDF
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
PDF
Do you think you're doing microservice architecture? What about infrastructur...
PPTX
Spring Integration 5.0: What's new?
PPTX
Spring one2gx 2014 erdemgunay
PDF
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
PDF
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
PDF
不只自動化而且更敏捷的Android開發工具 gradle mopcon
PDF
Intro to Reactive Programming
PDF
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse
PDF
Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ...
PDF
Curious Coders Java Web Frameworks Comparison
PPTX
Crossing the CI/CD/DevOps Chasm
PDF
Introduction to cloud-native application development: with Heroku and Spring ...
Reactor 3.0, a reactive foundation for java 8 and Spring
Adobe CQ at LinkedIn Meetup February 2014
Spring Tools 4 - Eclipse and Beyond
Documenting RESTful APIs with Spring REST Docs
What's New in Spring for Apache Kafka 2.0
Cloud Foundry Services on PKS with No Extra Code, "We Bosh So You Don’t Have ...
K8s at Scale in the Enterprise: Self-Service Through the View of Personas
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Do you think you're doing microservice architecture? What about infrastructur...
Spring Integration 5.0: What's new?
Spring one2gx 2014 erdemgunay
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
不只自動化而且更敏捷的Android開發工具 gradle mopcon
Intro to Reactive Programming
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse
Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ...
Curious Coders Java Web Frameworks Comparison
Crossing the CI/CD/DevOps Chasm
Introduction to cloud-native application development: with Heroku and Spring ...
Ad

Similar to riffing on Knative - Scott Andrews (20)

PDF
S1P: Spring Cloud on PKS
PPTX
Accelerating the Consumption of APIs Built on Cloud Foundry
PDF
Developer Secure Containers for the Cyberspace Battlefield
PPTX
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
PDF
P to V to C: The Value of Bringing “Everything” to Containers
PPTX
Spring Cloud on Kubernetes
PDF
Heavyweights: Tipping the Scales with Very Large Foundations
PPTX
Serverless Spring 오충현
PPTX
Policy Enforcement on Kubernetes with Open Policy Agent
PDF
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-In
PDF
Fast 5 Things You Can Do Now to Get Ready for the Cloud
PPTX
Containerizing a Data Warehouse for Kubernetes
PDF
Square Pegs, Square Holes: CI/CD That Fits
PPTX
What's new in Spring Boot 2.0
PDF
What's new in Reactor Californium
PPTX
How to Manage Microservices and APIs with Apigee and Istio
PPTX
PCF 2.3: A First Look
PPTX
It’s a Multi-Cloud World, But What About The Data?
PPTX
Experience + Education = Empowerment
PDF
Cloud-Native Streaming Platform: Running Apache Kafka on PKS (Pivotal Contain...
S1P: Spring Cloud on PKS
Accelerating the Consumption of APIs Built on Cloud Foundry
Developer Secure Containers for the Cyberspace Battlefield
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
P to V to C: The Value of Bringing “Everything” to Containers
Spring Cloud on Kubernetes
Heavyweights: Tipping the Scales with Very Large Foundations
Serverless Spring 오충현
Policy Enforcement on Kubernetes with Open Policy Agent
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-In
Fast 5 Things You Can Do Now to Get Ready for the Cloud
Containerizing a Data Warehouse for Kubernetes
Square Pegs, Square Holes: CI/CD That Fits
What's new in Spring Boot 2.0
What's new in Reactor Californium
How to Manage Microservices and APIs with Apigee and Istio
PCF 2.3: A First Look
It’s a Multi-Cloud World, But What About The Data?
Experience + Education = Empowerment
Cloud-Native Streaming Platform: Running Apache Kafka on PKS (Pivotal Contain...
Ad

More from VMware Tanzu (20)

PDF
Spring into AI presented by Dan Vega 5/14
PDF
What AI Means For Your Product Strategy And What To Do About It
PDF
Make the Right Thing the Obvious Thing at Cardinal Health 2023
PPTX
Enhancing DevEx and Simplifying Operations at Scale
PDF
Spring Update | July 2023
PPTX
Platforms, Platform Engineering, & Platform as a Product
PPTX
Building Cloud Ready Apps
PDF
Spring Boot 3 And Beyond
PDF
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
PDF
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
PDF
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
PPTX
tanzu_developer_connect.pptx
PDF
Tanzu Virtual Developer Connect Workshop - French
PDF
Tanzu Developer Connect Workshop - English
PDF
Virtual Developer Connect Workshop - English
PDF
Tanzu Developer Connect - French
PDF
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
PDF
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
PDF
SpringOne Tour: The Influential Software Engineer
PDF
SpringOne Tour: Domain-Driven Design: Theory vs Practice
Spring into AI presented by Dan Vega 5/14
What AI Means For Your Product Strategy And What To Do About It
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Enhancing DevEx and Simplifying Operations at Scale
Spring Update | July 2023
Platforms, Platform Engineering, & Platform as a Product
Building Cloud Ready Apps
Spring Boot 3 And Beyond
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
tanzu_developer_connect.pptx
Tanzu Virtual Developer Connect Workshop - French
Tanzu Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
Tanzu Developer Connect - French
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: Domain-Driven Design: Theory vs Practice

Recently uploaded (20)

PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PPTX
Matchmaking for JVMs: How to Pick the Perfect GC Partner
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
AI Guide for Business Growth - Arna Softech
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PPTX
most interesting chapter in the world ppt
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
Website Design Services for Small Businesses.pdf
PPTX
Download Adobe Photoshop Crack 2025 Free
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PDF
Microsoft Office 365 Crack Download Free
PPTX
Introduction to Windows Operating System
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Matchmaking for JVMs: How to Pick the Perfect GC Partner
BoxLang Dynamic AWS Lambda - Japan Edition
Topaz Photo AI Crack New Download (Latest 2025)
Visual explanation of Dijkstra's Algorithm using Python
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
AI Guide for Business Growth - Arna Softech
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
Advanced SystemCare Ultimate Crack + Portable (2025)
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
iTop VPN Crack Latest Version Full Key 2025
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
most interesting chapter in the world ppt
"Secure File Sharing Solutions on AWS".pptx
Website Design Services for Small Businesses.pdf
Download Adobe Photoshop Crack 2025 Free
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
Microsoft Office 365 Crack Download Free
Introduction to Windows Operating System

riffing on Knative - Scott Andrews

  • 1. riffing on Knative Scott Andrews @scothis
  • 2. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Safe Harbor Statement The following is intended to outline the general direction of Pivotal's offerings. It is intended for information purposes only and may not be incorporated into any contract. Any information regarding pre-release of Pivotal offerings, future updates or other planned modifications is subject to ongoing evaluation by Pivotal and is subject to change. This information is provided without warranty or any kind, express or implied, and is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions regarding Pivotal's offerings. These purchasing decisions should only be based on features currently available. The development, release, and timing of any features or functionality described for Pivotal's offerings in this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward looking information in this presentation. 2
  • 3. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Disclaimer everything is alpha Have fun(ctions), but not in production
  • 4. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo driven talk • Kubernetes primer • Serverless Kubernetes with Knative • Building and deploying a riff Function from source • Java • Node.js • commands • Invoking a riff Function • command driven functions • event driven functions Overview 4
  • 5. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Tools we’ll use • riff - riff is for functions https://github.com/projectriff/riff/releases • kubectl - Kubernetes CLI https://kubernetes.io/docs/tasks/tools/install-kubectl/ • kail - kubernetes tail https://github.com/boz/kail • watch - execute a program periodically, showing output fullscreen https://gitlab.com/procps-ng/procps 5 
  • 6. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo: Using k8s
  • 7. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What is riff
  • 8. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Knative Kubernetes-based platform to build, deploy, and manage modern serverless workloads Three core components: • Build - Source-to-container build orchestration • Serving - Request-driven compute that can scale to zero • Eventing - Management and delivery of events 100% open source. Created by Google with contributions from Pivotal and others 8 
  • 9. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 9 BuildTemplate Source Channel Build Knative Custom Resource Definitions Subscription refers to refers to creates and registers instance of Eventing Serving Build
  • 10. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ riff is for functions • event driven Function as a Service • opinionated experience built atop Knative, Kubernetes and Istio • functions practice Inversion of Control • no servers, ports or messaging protocols, just your logic • pick your language runtime: • Java/Spring • JavaScript/Node • executable commands • more from the community 1 0 
  • 11. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ riff on Knative Community-driven ecosystem of Sources, Channels, Functions, Invokers, BuildTemplates, etc. Kubernetes BuildTemplates Channels CLI Invokers CLI Invokers Build Topics
  • 12. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Installing riff (and Knative)
  • 13. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Creating a Kubernetes cluster 13 # https://projectriff.io/docs/getting-started/gke/ # create cluster gcloud container clusters create $CLUSTER_NAME --cluster-version=latest --machine-type=n1-standard-4 --enable-autoscaling --min-nodes=1 --max-nodes=3 --num-nodes=3 --enable-autorepair --scopes=service-control,service-management,compute-rw,storage-ro,cloud-platform,logging- write,monitoring-write,pubsub,datastore # grant yourself cluster-admin kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value core/account)
  • 14. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Install riff 14 # https://projectriff.io/docs/getting-started/gke/ # once per cluster riff system install # once per namespace riff namespace init $NAMESPACE --gcr $PATH_TO_GCR_CREDENTIALS
  • 15. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Install riff ...and dependencies including: • Istio • Knative Build • Knative Serving • Knative Eventing • In Memory Channel Provisioner • Kafka, Cloud Pub/Sub, NATSS are also available, but not installed • riff BuildTemplate - convert source to riff Function container images • credentials to push builds to an image registry 1 5 
  • 16. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo: Exploring Knative
  • 17. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 17 BuildTemplate Source Channel Build Knative Custom Resource Definitions Subscription refers to refers to creates and registers instance of Eventing Serving Build
  • 18. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ riff Functions
  • 19. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ a riff Java Function 19 // https://github.com/projectriff-samples/fats-uppercase-java package functions; import java.util.function.Function; public class Upper implements Function<String, String> { public String apply(String s) { return s.toUpperCase(); } }
  • 20. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ a riff JavaScript Function 2 0 // https://github.com/projectriff-samples/fats-uppercase-node module.exports = s => s.toUpperCase();
  • 21. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ a riff Command Function 21 # https://github.com/projectriff-samples/fats-uppercase-command #!/bin/sh tr '[a-z]' '[A-Z]'
  • 22. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo: riff Functions
  • 23. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Deploy a riff Function 2 3 riff function create square --git-repo https://github.com/projectriff-samples/node-square --artifact square.js --verbose kail -l riff.projectriff.io/function=square -c user-container
  • 24. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function 2 4 riff service invoke square --json -- -w 'n' -d 7
  • 25. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Let’s create another function 2 5 riff function create greet --git-repo https://github.com/projectriff-samples/command-hello --artifact greet.sh riff service invoke greet --text -- -w 'n' -d "Washington"
  • 26. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo: Local Functions
  • 27. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Iterating quickly (in development) 2 7 riff function local run --local-path ./uppercase curl localhost:8080 -H 'Content-Type: text/plain' -w 'n' -d 'shhh!'
  • 28. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Run on cluster from local source 2 8 riff function create uppercase --local-path ./uppercase --verbose riff service invoke uppercase --text -- -w 'n' -d 'shhh!'
  • 29. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo: Event Driven Functions
  • 30. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function with events 3 0 riff channel create numbers riff channel create squares riff subscription create --channel numbers --subscriber square --reply squares riff service create correlator --image scothis/correlator:s1tour
  • 31. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function with events 31 correlator numbers squaressquare riff invoke /numbers
  • 32. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo: Function Chaining
  • 33. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function with events 3 3 riff service invoke correlator /s1tour/numbers --json -- -w 'n' -v -d 7
  • 34. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 3 4 correlator numbers replies squaressquaregreet riff invoke /numbers
  • 35. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Let’s chain our functions 3 5 riff channel create replies riff subscription create --channel squares --subscriber greet --reply replies riff subscription create --channel replies --subscriber correlator
  • 36. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function with events 3 6 riff service invoke correlator /s1tour/numbers --json -- -H "Knative-Blocking-Request: true" -w 'n' -d 7
  • 37. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 3 7
  • 38. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 3 8
  • 39. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 3 9
  • 40. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 4 0
  • 41. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 41
  • 42. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 4 2
  • 43. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Other patterns are possible 4 3 correlator numbers replies squaressquaregreet riff invoke /numbers dead-beef-00 GET /dead-beef-00
  • 44. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ There's more we didn't have time to show... 4 4 • alternate Eventing Channels • Kafka • NATSS • Google Cloud PubSub • Eventing Sources • Cloud Events • alternate BuildTemplates • Buildah • jib • kaniko • deploying Knative from source • Istio • public DNS • Autoscaler tuning • monitoring • Grafana • Prometheus • Zipkin You can learn more at https://www.knative.dev
  • 45. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Free eBook http://bit.ly/getting-started-with-knative Hot off the press
  • 46. > join us at projectriff.io @projectriff