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
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
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo driven talk • Installing riff into a Kubernetes cluster • Building and deploying a riff Function from source • Invoking a riff Function • command driven functions • event driven functions Overview 4
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 7 
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
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 HTTP, just your logic • pick your language runtime: • Java/Spring • JavaScript/Node • executable commands • more from the community 9 
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Install riff ...and dependencies including: • Knative Serving • Istio • Knative Build • Knative Eventing • Stub Bus • Kafka and Cloud Pub/Sub are also available, but not installed • credentials to push builds to an image registry • riff BuildTemplate - convert source to riff Function container images 1 2 
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Install riff 13 # https://projectriff.io/docs/getting-started-on-gke/ # once per cluster riff system install # once per namespace riff namespace init $NAMESPACE --gcr $PATH_TO_GCR_CREDENTIALS
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Create a riff Function 15 # square.js module.exports = x => { const xx = x ** 2; console.log(`the square of ${x} is ${xx}`); return xx; }
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function with events 17 correlator numbers squares square riff invoke /numbers
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function 19 riff service invoke square --json -- \ -w '\n' \ -d 7
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function with events 21 riff service invoke correlator /numbers --json -- \ -w '\n' \ -v \ -d 7
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 2 4 correlator numbers replies squares square greet riff invoke /numbers
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke a riff Function with events 2 6 riff service invoke correlator /numbers --json -- \ -H "Knative-Blocking-Request: true" \ -w '\n' \ -d 7
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 2 7
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 2 8
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 2 9
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 0
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Invoke the riff Function with events 31
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 2
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Other patterns are possible 3 3 correlator numbers replies squares square greet riff invoke /numbers dead-beef-00 GET /dead-beef-00
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... 3 4 • YAML • Java/Spring (yes, we know this is SpringOne) • alternate Eventing Buses • Google Cloud PubSub • Kafka • 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://github.com/knative/docs