Slide 1

Slide 1 text

on Kubernetes, and OpenShift Knative & Serverless RED HAT OPENSHIFT SERVERLESS Chris Suszynski twitter.com/ksuszynski 1

Slide 2

Slide 2 text

About me 2 Chris Suszynski ● Senior Quality Engineer at Red Hat ● Work on OpenShift Serverless ● Java & Puppet enthusiast ● Golang lover (1y) ● 15y+ of development experience ● using DevOps from ~2010, trainer from 2014 ● breathe Open Source ~70 original OSS repos ● public speaker on meetups & conferences ● happy father & husband

Slide 3

Slide 3 text

Agenda 3 RED HAT OPENSHIFT SERVERLESS 1. Introduction 2. What is Serverless & Knative? 3. Serverless vs FaaS 4. Knative components overview 5. Knative Serving 6. Knative Eventing 7. OpenShift Serverless 8. Q&A

Slide 4

Slide 4 text

Start with something cool! 4 Demo/Labs

Slide 5

Slide 5 text

Unpopular opinion 5 “Most enterprise applications are still monolithic“

Slide 6

Slide 6 text

Monolith 6 MyBank

Slide 7

Slide 7 text

Inside monolith 7

Slide 8

Slide 8 text

Dividing monolith 8

Slide 9

Slide 9 text

Enter microservices 9

Slide 10

Slide 10 text

Enter microservices 10

Slide 11

Slide 11 text

Enter microservices 11

Slide 12

Slide 12 text

Network of microservices 12

Slide 13

Slide 13 text

Microservices with their data 13

Slide 14

Slide 14 text

Multiple points of entry 14

Slide 15

Slide 15 text

Teams & pipelines 15

Slide 16

Slide 16 text

Mindblown 16

Slide 17

Slide 17 text

Scary transformation 17 Lovely Little Big Mono Every 3 months Every week/day/hour

Slide 18

Slide 18 text

We need new ideas 18 “We cannot solve our problems with the same thinking we used when we created them” ⸺ Albert Einstein (Theoretical Physicist)

Slide 19

Slide 19 text

19 Road to Awesomeness Self-Service, On-Demand, Elastic Infrastructure Automation CI & CD Deployment Pipeline Advanced Deployment Techniques Microservices Re-Org to DevOps

Slide 20

Slide 20 text

20 Serverless Computing

Slide 21

Slide 21 text

Serverless computing 21 What is ? “Serverless computing refers to the concept of building and running applications that do not require server management. It describes a finer-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment.” ⸺ Cloud Native Computing Foundation https://www.cncf.io/blog/2018/02/14/cncf-takes-first-step-towards-serverless-computing

Slide 22

Slide 22 text

22 Short history of Serverless AWS S3 March 2006 AWS Lambda November 2014 AWS EC2 August 2006 Serverless Described Thoughtworks August 2016 Serverless Coined October 2012 Serverless Assess Thoughtworks Radar April 2016 AWS Dynamo DB January 2012 Firebase September 2011 Iron.io July 2011 Google Cloud Function Feb 2016 Azure Functions Mar 2016 Pivotal Riff Dec 2017 Oracle Functions Sept 2016 IBM Bluemix OpenWhisk Feb 2016 Oracle Fn Project Oct 2017

Slide 23

Slide 23 text

Serverless vs FaaS 23 Serverless ● No server mgmt ● Ease of use ● Scales to zero FaaS ● Builds and runs your function ● Atomic size

Slide 24

Slide 24 text

FaaS Kubernetes Players 24

Slide 25

Slide 25 text

25 Knative

Slide 26

Slide 26 text

26 Knative announced July 24, 2018

Slide 27

Slide 27 text

Knative? 27 What is ● Open source project started by Google ● Serverless computing on Kubernetes ● Set of loosely coupled primitives for all ● Makes using Kubernetes easier for Dev & Ops ● Autoscaling, from zero to ∞ ● Advanced techniques like Blue/Green deployments, eventing system

Slide 28

Slide 28 text

Knative’s Primary Components 28 Serving Eventing Cli Build X Replaced with Tekton

Slide 29

Slide 29 text

29 Knative primitives DX Functions Event Sources Build Tools Vendors FaaS Stuff Traffic shaping Autoscaling Invokers Event Binding Routing Observability Serverless Stuff Deployment Replicaset Pod Service CRD Infrastructure

Slide 30

Slide 30 text

30 What Knative provides? Traffic shaping Autoscaling Invokers Event Binding Routing Observability Serverless Stuff "Knative provides a set of middleware components that are essential to build modern, source-centric, and container-based applications that can run anywhere: on premises, in the cloud, or even in a third-party data center"

Slide 31

Slide 31 text

Interesting Capabilities 31 • Scale-to-zero: No pod == no memory • Scale-from-zero: Traffic spike starts N pods • Configurations & Revisions - built-in Blue/Green • In-Cluster Image Building (Tekton) • Traffic splitting • Eventing System

Slide 32

Slide 32 text

1,000 feet view 32

Slide 33

Slide 33 text

Knative 33 Exercises ● bit.ly/knative-tutorial ● developers.redhat.com/coderland/serverless

Slide 34

Slide 34 text

Knative Serving 34 A closer look

Slide 35

Slide 35 text

Kubernetes service & deployment 35 Deployment Replicaset Pod Service Pod Pod

Slide 36

Slide 36 text

kubectl get crd | grep serving configurations.serving.knative.dev revisions.serving.knative.dev routes.serving.knative.dev services.serving.knative.dev Knative Serving CRD’s 36

Slide 37

Slide 37 text

Knative service 37 Deployment N Replicaset N Pod Service Pod Pod N Configuration Revision N serving.knative.dev/v1alpha1 Service Route Service Istio Gateway VirutalService Activator ImageCache PodAutoscaler ClusterIngress

Slide 38

Slide 38 text

kubectl -n knative-serving edit configmap config-autoscaler container-concurrency-target-default: "100" scale-to-zero-grace-period: 60s stable-window: 30s Knative Serving Autoscaler 38

Slide 39

Slide 39 text

Knative Serving 39 Demo/Labs

Slide 40

Slide 40 text

Knative Eventing 40 A closer look

Slide 41

Slide 41 text

kubectl get crd | grep eventing channels.eventing.knative.dev subscriptions.eventing.knative.dev brokers.eventing.knative.dev cronjobsources.sources.eventing.knative.dev githubsources.sources.eventing.knative.dev kuberneteseventsources.sources.eventing.knative.dev containersources.sources.eventing.knative.dev Knative Eventing CRD’s 41

Slide 42

Slide 42 text

Knative Eventing elements 42 Kafka implementation Topic Event Producer Event Source Channel Broker Trigger Subscription Kafka implementation Topic Trigger Filtering Knative Service

Slide 43

Slide 43 text

Cloud Events 43 Knative Eventing use CloudEvents

Slide 44

Slide 44 text

Knative Eventing Sources 44 ● Github ● Websockets ● AWS SQS ● GCP PubSub ● Apache Kafka ● Apache Camel ● github.com/knative/eventing-contrib ● github.com/knative/eventing-sources

Slide 45

Slide 45 text

Knative Eventing 45 Demo/Labs

Slide 46

Slide 46 text

46 OpenShift Serverless

Slide 47

Slide 47 text

OpenShift Serverless? 47 What is ● Red Hat product, based on Knative project ● Uses Red Hat Service Mesh, in future Kourier ● Supported & tested Knative on OpenShift ● Focus on Developer Experience (DX) ● Easy to install with OpenShift Operator Hub ● Awesome administration console

Slide 48

Slide 48 text

OpenShift Serverless 48 Demo/Labs

Slide 49

Slide 49 text

49 Knative Resources ● bit.ly/knative-tutorial ● developers.redhat.com/coderland/serverless ● github.com/cardil/knative-kafka-demo ● bit.ly/kubernetes-tutorial ● bit.ly/istio-tutorial ● bit.ly/quarkus-tutorial ● developers.redhat.com

Slide 50

Slide 50 text

linkedin.com/in/krzysztof-suszynski youtube.com/user/RedHatVideos facebook.com/RedHatDeveloperProgram twitter.com/ksuszynski RED HAT OPENSHIFT SERVERLESS 50 red.ht/openshift Thank you.