Slide 1

Slide 1 text

Beyond Kubernetes Managing Applications and Functions with Knative, riff, and Spring Cloud Functions Eric Bottard @ebottard Pivotal Ray Tsang @saturnism Google

Slide 2

Slide 2 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Ray Tsang Developer Advocate Google Cloud Platform Spring Cloud GCP cloud.spring.io/spring-cloud-gcp/ JHipster, JDeferred Java Champion @saturnism | saturnism.me

Slide 3

Slide 3 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Eric Bottard Sr Software Engineer Pivotal Spring Cloud DataFlow cloud.spring.io/spring-cloud-dataflow/ Project riff https://projectriff.io/ @ebottard

Slide 4

Slide 4 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Kubernetes - Looking under the hood Knative - Why and How riff - A FaaS on top of Knative Serving - via a manual deployment Build - via riff function create Eventing - via riff function chaining Spring Cloud Function - platform agnostic functions End to End - everything we've learned Things We'll Cover

Slide 5

Slide 5 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: app/v1 kind: Deployment metadata: name: helloworld ... spec: replicas: 2 template: ... spec: containers: - name: helloworld image: saturnism/helloworld:v1

Slide 6

Slide 6 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio web browsers Scheduler kubectl web browsers scheduler Kubelet Kubelet Kubelet Kubelet Config file Kubernetes Master Container Image

Slide 7

Slide 7 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Let's See It

Slide 8

Slide 8 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Deployment

Slide 9

Slide 9 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio ReplicaSet Deployment

Slide 10

Slide 10 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Pod

Slide 11

Slide 11 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Deployment apiVersion: app/v1 kind: Deployment metdatdata: name: nginx spec: replicas: 2 template: ... spec: containers: - name: nginx image: nginx

Slide 12

Slide 12 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Deployment Deployment Controller apiVersion: app/v1 kind: Deployment metdatdata: name: nginx spec: replicas: 2 template: ... spec: containers: - name: nginx image: nginx

Slide 13

Slide 13 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio ReplicaSet Deployment Deployment Controller Create apiVersion: app/v1 kind: ReplicaSet metadata: name: nginx-1234 spec: replicas: 2 template: ... spec: containers: - name: nginx image: nginx

Slide 14

Slide 14 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio ReplicaSet Deployment Deployment Controller Replication Controller Create apiVersion: app/v1 kind: ReplicaSet metadata: name: nginx-1234 spec: replicas: 2 template: ... spec: containers: - name: nginx image: nginx

Slide 15

Slide 15 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Deployment Controller apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-k5jv spec: ... containers: - name: nginx image: nginx Replication Controller Create Create Pod apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-q7jd spec: ... containers: - name: nginx image: nginx

Slide 16

Slide 16 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Deployment Controller Replication Controller Create Create Scheduler Pod apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-k5jv spec: ... containers: - name: nginx image: nginx apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-q7jd spec: ... containers: - name: nginx image: nginx

Slide 17

Slide 17 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Deployment Controller Replication Controller Create Create Scheduler Assign to Node Pod apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-k5jv spec: ... containers: - name: nginx image: nginx nodeName: node-1 apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-q7jd spec: ... containers: - name: nginx image: nginx nodeName: node-2

Slide 18

Slide 18 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Deployment Controller Replication Controller Create Create Scheduler Assign to Node Pod Kubelet apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-k5jv spec: ... containers: - name: nginx image: nginx nodeName: node-1 apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-q7jd spec: ... containers: - name: nginx image: nginx nodeName: node-2

Slide 19

Slide 19 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Deployment Controller Replication Controller Create Create Scheduler Assign to Node Pod Kubelet Start the container! apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-k5jv spec: ... containers: - name: nginx image: nginx nodeName: node-1 status: ... apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-q7jd spec: ... containers: - name: nginx image: nginx nodeName: node-2 status: ...

Slide 20

Slide 20 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Deployment Controller Replication Controller Create Create Scheduler Assign to Node Pod Kubelet Update Status Start the container! apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-k5jv spec: ... containers: - name: nginx image: nginx nodeName: node-1 status: ... apiVersion: app/v1 kind: Pod metadata: name: nginx-1234-q7jd spec: ... containers: - name: nginx image: nginx nodeName: node-2 status: ...

Slide 21

Slide 21 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Pod ReplicaSet Deployment Pod

Slide 22

Slide 22 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio You can write your own Resource & Controller!

Slide 23

Slide 23 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: gameservers.stable.agones.dev spec: group: stable.agones.dev version: v1alpha1 scope: Namespaced names: kind: GameServer plural: gameservers shortNames: - gs singular: gameserver Custom Resource Definition https://github.com/GoogleCloudPlatform/agones

Slide 24

Slide 24 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: gameservers.stable.agones.dev spec: group: stable.agones.dev version: v1alpha1 scope: Namespaced names: kind: GameServer plural: gameservers shortNames: - gs singular: gameserver Custom Resource Definition apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: gameservers.stable.agones.dev spec: group: stable.agones.dev version: v1alpha1 scope: Namespaced names: ... validation: openAPIV3Schema: required: - spec properties: spec: required: - template ... With Validation

Slide 25

Slide 25 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer metadata: name: "simple-udp" spec: ports: - name: default portPolicy: "dynamic" containerPort: 7654 template: spec: containers: - name: simple-udp image: gcr.io/agones-images/udp-server:0.4 Custom Resource

Slide 26

Slide 26 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer metadata: name: "simple-udp" spec: ports: - name: default portPolicy: "dynamic" containerPort: 7654 template: spec: containers: - name: simple-udp image: gcr.io/agones-images/udp-server:0.4 Custom Resource Controller Game Server Controller

Slide 27

Slide 27 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer metadata: name: "simple-udp" spec: ports: - name: default portPolicy: "dynamic" containerPort: 7654 template: spec: containers: - name: simple-udp image: gcr.io/agones-images/udp-server:0.4 Custom Resource Controller Game Server Controller Deployment Create

Slide 28

Slide 28 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer metadata: name: "simple-udp" spec: ports: - name: default portPolicy: "dynamic" containerPort: 7654 template: spec: containers: - name: simple-udp image: gcr.io/agones-images/udp-server:0.4 Custom Resource Controller Game Server Controller ReplicaSet Deployment Create

Slide 29

Slide 29 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer metadata: name: "simple-udp" spec: ports: - name: default portPolicy: "dynamic" containerPort: 7654 template: spec: containers: - name: simple-udp image: gcr.io/agones-images/udp-server:0.4 Custom Resource Controller Game Server Controller Pod ReplicaSet Deployment Pod Create

Slide 30

Slide 30 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative

Slide 31

Slide 31 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Zero to Kubernetes Kubernetes Write code Build docker image Upload image to registry Deploy with Deployment Expose to the internet HTTP Load Balancing Scale workload

Slide 32

Slide 32 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Higher Level Abstraction Kubernetes Write code Build docker image Upload image to registry Deploy with Deployment Expose to the internet HTTP Load Balancing Scale workload Would Be Nice... Write code :D Deploy!

Slide 33

Slide 33 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Building higher level abstraction

Slide 34

Slide 34 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Introducing Knative Kubernetes-based building blocks for serverless workloads

Slide 35

Slide 35 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio ● Set of primitives (Build, Events, Serving) ● Solves for modern development patterns ● Implements learnings from Google, partners ● Ingredient or platform for OSS FaaS frameworks github.com/knative Introducing Knative Kubernetes-based building blocks for serverless workloads

Slide 36

Slide 36 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio The Knative stack Kubernetes Platform

Slide 37

Slide 37 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio The Knative stack Kubernetes Platform Istio Service Mesh

Slide 38

Slide 38 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio The Knative stack Kubernetes Platform Istio Service Mesh Build Primitives Serving Events

Slide 39

Slide 39 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative is ... native

Slide 40

Slide 40 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio riff

Slide 41

Slide 41 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio 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 riff is for functions

Slide 42

Slide 42 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio riff on Knative Community-driven ecosystem of Sources, Channels, Functions, Invokers, BuildTemplates, etc. Kubernetes BuildTemplates Channels CLI Invokers CLI Invokers Build Topics

Slide 43

Slide 43 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Target Audience(s)

Slide 44

Slide 44 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Serving

Slide 45

Slide 45 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio The Knative Serving project provides middleware primitives that enable: Automatic scaling up and down to zero Routing and network programming for Istio components Point-in-time snapshots of deployed code and configurations Knative Serving

Slide 46

Slide 46 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Serving defines principled objects Knative defines primitives with clear separation of concerns So far, we used Service, a lite version of Knative objects spec: container: image: gcr.io/knative-samples/simple-app:latest env: - name: SIMPLE_MSG value: "Hello GCP Next 2018!" Service

Slide 47

Slide 47 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Serving defines principled objects Knative defines primitives with clear separation of concerns Configuration Current/desired state for your application Code & configuration (separated, ala 12 factor) Configuration Service

Slide 48

Slide 48 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Serving defines principled objects Knative defines primitives with clear separation of concerns Configuration Current/desired state for your application Code & configuration (separated, ala 12 factor) Revision Point in time snapshots for your code and configuration Revision Configuration Service

Slide 49

Slide 49 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Serving defines principled objects Revision Knative defines primitives with clear separation of concerns Configuration Current/desired state for your application Code & configuration (separated, ala 12 factor) Revision Point in time snapshots for your code and configuration Route Maps traffic to a revisions Supports fractional, named routing Route Configuration Service

Slide 50

Slide 50 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Revision Route Configuration Knative Service

Slide 51

Slide 51 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Revision Route Configuration Knative Service Deployment Kubernetes Service

Slide 52

Slide 52 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Revision Route Configuration Knative Service ReplicaSet Deployment Kubernetes Service

Slide 53

Slide 53 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Revision Route Configuration Knative Service Pod ReplicaSet Deployment Pod Kubernetes Service

Slide 54

Slide 54 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Revision Route Configuration Knative Service Pod ReplicaSet Deployment Pod Istio Virtual Service Kubernetes Service

Slide 55

Slide 55 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio ServiceCRD - creates route and configuration, for either latest or pinned revision RouteCRD - maps a network endpoint to one or more revisions, enabling traffic policy management across revisions ConfigurationCRD - mutable desired state for your deployment, with each modification creating a new revision RevisionCRD - immutable point-in-time snapshot for each modification made to the workload code/config Knative Serving CRDs

Slide 56

Slide 56 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Demo: Deploying and updating live service Blue-green deployment model Route 100% Revision 0001 Configuration kind: Route ... spec: traffic: - revisionName: blue-green-00001 percent: 100

Slide 57

Slide 57 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Blue-green deployment model kind: Route ... spec: traffic: - revisionName: blue-green-00001 percent: 100 - revisionName: blue-green-00002 percent: 0 name: v2 Deploy updated version of the service ● Blue continues to take 100% of traffic ● Named route (v2) to green version Revision 00002 Route 100% Revision 00001 0% v2 Configuration Configuration

Slide 58

Slide 58 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Blue-green deployment model Update service configuration ● Send % of traffic to green ● Still have explicit v2 route kind: Route ... spec: traffic: - revisionName: blue-green-00001 percent: 50 - revisionName: blue-green-00002 percent: 50 name: v2 Revision 00002 Route 98% Revision 00001 2% (Experiment) Configuration Configuration

Slide 59

Slide 59 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Blue-green deployment model Update service configuration ● Incrementally add %, until all traffic is on green ● Keep explicit named route to blue Secured with RBAC-based ACL kind: Route ... spec: traffic: - revisionName: blue-green-00001 percent: 0 name: v1 - revisionName: blue-green-00002 percent: 100 Revision 00002 Route 0% v1 Revision 00001 100% Configuration Configuration

Slide 60

Slide 60 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Build

Slide 61

Slide 61 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Build is a custom resource in Knative that allows you to define a process that runs to completion and can provide status. For example, fetch, build, and package your code by using a Knative Build that communicates whether the process succeeds. A Knative Build runs on-cluster [...] to build the source code of your apps into container images, which you can then run on Knative serving. Knative Build https://github.com/knative/docs/tree/master/build

Slide 62

Slide 62 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio a BuildCRD = specific instance of a process made of steps runs a sequence of images, aka Builders a BuildTemplateCRD = a recipe for instantiating BuildsCRD. accepts parameters runs under a given ServiceAccount can hold credentials Key Concepts of Knative Build

Slide 63

Slide 63 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Build - Plenty to Choose From

Slide 64

Slide 64 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio DEMO

Slide 65

Slide 65 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Square.js module.exports = x => x ** 2;

Slide 66

Slide 66 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio W A I T ⏯ ⏪

Slide 67

Slide 67 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Eventing

Slide 68

Slide 68 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Knative Events is a system which is designed to address a common need for cloud native development: 1. Services are loosely coupled during development and deployed independently on a variety of platforms (Kubernetes, VMs, SaaS or FaaS). 2. A producer can generate events before a consumer is listening, and a consumer can express an interest in an event or class of events that is not yet being produced. 3. Services can be connected to create new applications without modifying producer or consumer. With the ability to select a specific subset of events from a particular producer Knative Eventing https://github.com/knative/docs/tree/master/eventing

Slide 69

Slide 69 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio ChannelCRD is a network endpoint which receives (and optionally persists) events using a Bus-specific implementation. SubscriptionCRD connects events received on a Channel to an interested target, represented as a DNS name. There may be multiple Subscriptions on a single channel. Bus* defines the adaptation layers needed to implement channels and subscriptions using a specific persistence strategy (such as delivery of events to a Kafka topic). Knative Eventing Also: Sources, Flows source channel function flow subscription

Slide 70

Slide 70 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Loosely Coupled Example square

Slide 71

Slide 71 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Loosely Coupled Example square correlator riff service create correlator --image projectriff/correlator:fats

Slide 72

Slide 72 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Loosely Coupled Example numbers square correlator riff channel create numbers --cluster-bus stub

Slide 73

Slide 73 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Loosely Coupled Example numbers square correlator squares riff channel create squares --cluster-bus stub

Slide 74

Slide 74 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio riff subscription create --channel numbers --subscriber square --reply-to squares A Loosely Coupled Example numbers square correlator squares

Slide 75

Slide 75 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Loosely Coupled Example numbers square greet correlator squares riff function create command greet \ --image gcr.io/$GCP_PROJECT/riff-sample-greet \ --git-repo https://github.com/projectriff-samples/command-hello \ --artifact greet.sh \ --verbose

Slide 76

Slide 76 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Loosely Coupled Example numbers square replies greet correlator squares riff channel create replies --cluster-bus stub

Slide 77

Slide 77 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio riff subscription create -c squares -s greet -r replies A Loosely Coupled Example numbers square replies greet correlator squares

Slide 78

Slide 78 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio riff subscription create -c replies -s correlator A Loosely Coupled Example numbers square replies greet correlator squares

Slide 79

Slide 79 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A Loosely Coupled Example numbers square replies greet correlator squares /numbers

Slide 80

Slide 80 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio DEMO

Slide 81

Slide 81 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Kubernetes is extensible Knative is a platform for platforms Serving scale to/from zero. Route traffic Build optionally build from source Eventing decouple workloads in space / time riff is a FaaS on top of Knative Let's Recap

Slide 82

Slide 82 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Spring Cloud Function

Slide 83

Slide 83 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Working with Spring Cloud Function Serverless Functions the Spring way ● Promote the implementation of business logic via functions ● Abstract away the target runtime ○ Supports multiple Function as a Service platform ● Support a uniform programming model across serverless providers ○ Run standalone (locally or in a PaaS). ● Enable Spring Boot features on serverless providers ○ Auto-configuration ○ Dependency injection ○ Metrics

Slide 84

Slide 84 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A serverless function by itself is ... ● kind of pointless ... we need a way to deploy it and to invoke it ● include the function in an app ● invoke it via a standalone invoker app ● deploy it to a FaaS

Slide 85

Slide 85 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A function package com.springdeveloper.demo.functionapp; import java.util.function.Function; public class Upper implements Function { public String apply(String name) { return name.toUpperCase(); } }

Slide 86

Slide 86 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio A function invoker package com.springdeveloper.demo.functionapp; import java.util.function.Function; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @SpringBootApplication public class FunctionAppApplication { @Bean public Function uppercase() { return s -> s.toUpperCase(); } public static void main(String[] args) { SpringApplication.run(FunctionAppApplication.class, args); } }

Slide 87

Slide 87 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Let's build something...

Slide 88

Slide 88 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Spring Cloud GCP Goals Provide integration between GCP services and Spring Meet developers where they are Cut down on boilerplate code +

Slide 89

Slide 89 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Feature GCP Service Spring Framework Authentication Auto credential discovery. Service Accounts. Configuration Cloud Runtime Config Spring Cloud Config Messaging Cloud Pub/Sub Spring Integration Spring Cloud Stream Spring Dataflow Database Cloud SQL Cloud Spanner Spring Data Spring Data Spanner Storage Cloud Storage Spring Resource Logging Stackdriver Logging Logback Trace Stackdriver Trace Spring Cloud Sleuth

Slide 90

Slide 90 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Vision API ● Analyze what's inside of an image ● Feature detection such as ○ labels (is there a cat?) ○ text extraction ○ facial features and emotion ○ Landmarks ○ Logos ○ safe search ○ ...

Slide 91

Slide 91 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Kubernetes Basics Knative - Why and How riff - A FaaS on top of Knative Serving - via a manual deployment Build - via riff function create Eventing - via riff function chaining End to End - everything we've learned Things We Saw

Slide 92

Slide 92 text

@saturnism @gcpcloud / @ebottard @pivotal / @projectriff @knativeproject @kubernetesio Thanks! Give it a try! Project riff projectriff.io Install, Samples, Docs github.com/knative/docs Spring Cloud Function, Knative, Riff Code Lab bit.ly/spring-riff-lab Want to contribute? knative/docs/community Have questions? knative.slack.com