Slide 1

Slide 1 text

CONFIDENTIAL designator V0000000 An event-driven adventure in the serverless metaverse with OpenShift Serverless Functionia Aykut Bulgu Senior Content Architect 1

Slide 2

Slide 2 text

CONFIDENTIAL designator V0000000 Me as Code 2 #oc apply -f aykutbulgu.yaml apiVersion: redhat/v3.8 kind: Senior Content Architect metadata: name: Aykut Bulgu namespace: Red Hat Global Learning Services annotations: twitter: @systemcraftsman email: - [email protected] - [email protected] organizer: Software Craftsmanship Turkey founder: System Craftsman labels: married: yes children: 1 interests: - tech (mostly kafka) - aikido - gamification - stoicism spec: replicas: 1 containers: - image: aykut:latest

Slide 3

Slide 3 text

CONFIDENTIAL designator V0000000 What do we have in the webinar? 3 ➔ Traditional long-running application architecture and its drawbacks. ➔ OpenShift Serverless Serving and creating functions. ➔ OpenShift Serverless Eventing and how it solves problems by: ◆ Reducing the coupling between services. ◆ Providing autoscale and scale-to-zero capabilities to the applications. ➔ Building blocks for eventing like source, channel, subscription, sink, and more. ➔ CloudEvents usage in an OpenShift Serverless Eventing architecture.

Slide 4

Slide 4 text

CONFIDENTIAL designator V0000000 Functionia: The serverless metaverse 4

Slide 5

Slide 5 text

CONFIDENTIAL designator V0000000 Functionia: The serverless metaverse 5

Slide 6

Slide 6 text

CONFIDENTIAL designator V0000000 Meet OSVR-4 6 Hello. I am OSVR-4. I will help you through your journey in Functionia.

Slide 7

Slide 7 text

CONFIDENTIAL designator V0000000 The Problem 7

Slide 8

Slide 8 text

CONFIDENTIAL designator V0000000 Functionia: The serverless metaverse 8 ➔ Miner clans do bitmining in a daily basis. ➔ Sometimes no bitmining is done. ◆ No economical bitmining architecture ◆ Resources are used for nothing ➔ Code bases of miner apps are too complex. ◆ There are more than one technology as there are more than one clan. ◆ Harder development life-cycle. ➔ In case of failures in the miner clans, there is no retry mechanism. All processes are synchronous. ➔ Quakers miner clan face a lot of issues like these recently.

Slide 9

Slide 9 text

CONFIDENTIAL designator V0000000 Functionia: The serverless metaverse 9 I have a solution for you: Openshift Serverless!

Slide 10

Slide 10 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 10

Slide 11

Slide 11 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 11 OpenShift Serverless ➔ Deploy and run serverless containers ➔ Use any programming language or runtime ➔ Modernize existing applications to run serverless ➔ Powered by a rich ecosystem of event sources ➔ Manage serverless apps natively in Kubernetes ➔ Based on open source project Knative ➔ Run anywhere OpenShift runs OPENSHIFT OpenShift Serverless SERVING EVENTING Red Hat Enterprise Linux CoreOS Physical Virtual Private cloud Public cloud Applications Events F

Slide 12

Slide 12 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 12 Immutable revisions Deploy new features performing canary, A/B or blue-green testing with gradual traffic rollout with no sweat and following best practices. Any programming language Use any programming language or runtime of choice. From Java, Python, Go and JavaScript to Quarkus, SpringBoot or Node.js. No need to configure number of replicas, or idling. Scale to zero when not in use, auto scale to thousands during peak, with built-in reliability and fault-tolerance. Automatic scaling Use a simplified developer experience to deploy and run serverless containers abstracting infrastructure & focusing what matters. Containers made easy prem aws Ready for the Hybrid Cloud True portable serverless running anywhere OpenShift runs, that is on premise or on any cloud. Leverage data locality and SaaS when needed. azure Event Driven Architecture Build loosely coupled & distributed apps connecting with a variety of built-in or third-party event sources connectors powered by Operators.

Slide 13

Slide 13 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 13

Slide 14

Slide 14 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 14 But how is it supposed to help us?

Slide 15

Slide 15 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 15 SERVING An event-driven model that serves the container with your application and can "scale to zero". Common infrastructure for consuming and producing events that will stimulate applications. EVENTING ➔ Autoscaling with scale-to-zero ➔ Advanced networking ➔ Immutable revisions ➔ Traffic splitting ➔ Knative Service ➔ Functions ➔ Serverless workloads with event-driven architecture ➔ Source ◆ Kafka Source ➔ Channel ◆ Kafka Channel ➔ Subscription ➔ Broker ➔ Trigger

Slide 16

Slide 16 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 16 apiVersion: apps/v1 kind: Deployment metadata: name: frontend labels: app: guestbook spec: selector: matchLabels: app: guestbook tier: frontend replicas: 1 template: metadata: labels: app: guestbook tier: frontend spec: containers: - image: markusthoemmes/guestbook name: guestbook resources: requests: cpu: 100m memory: 100Mi env: - name: GET_HOSTS_FROM value: dns ports: - containerPort: 80 apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: name: frontend spec: template: metadata: labels: app: guestbook tier: frontend spec: containers: - image: markusthoemmes/guestbook resources: requests: cpu: 100m memory: 100Mi env: - name: GET_HOSTS_FROM value: dns ports: - containerPort: 80 --- apiVersion: v1 kind: Service metadata: name: frontend-service labels: app: guestbook tier: frontend spec: ports: - port: 80 selector: app: guestbook tier: frontend --- apiVersion: route.openshift.io/v1 kind: Route metadata: name: frontend-route spec: to: kind: Service name: frontend-service OpenShift OpenShift Serverless apiVersion: extensions/v1beta1 kind: HorizontalPodAutoscaler metadata: name: guestbook namespace: default spec: scaleRef: kind: ReplicationController name: guestbook namespace: default subresource: scale minReplicas: 1 maxReplicas: 10 cpuUtilization: targetPercentage: 50 22 lines ~70 lines

Slide 17

Slide 17 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 17 Service Microservice Function > Single Purpose > Stateless > Independently Scalable > Automated > Single Action > Ephemeral > Autonomous > Loosely-coupled f( )

Slide 18

Slide 18 text

CONFIDENTIAL designator V0000000 OpenShift Serverless 18 So let’s roll up our sleeves and start the implementation!

Slide 19

Slide 19 text

CONFIDENTIAL designator V0000000 Source to Sink 19 Quakers Knative Service (ksvc)

Slide 20

Slide 20 text

CONFIDENTIAL designator V0000000 Source to Sink 21 This is great! Thank you.

Slide 21

Slide 21 text

CONFIDENTIAL designator V0000000 Source to Sink 22 Oh, but we have the Noders clan too. Hi!

Slide 22

Slide 22 text

CONFIDENTIAL designator V0000000 Channel and Subscriptions 23 What about using a Channel and Subscriptions?

Slide 23

Slide 23 text

CONFIDENTIAL designator V0000000 Channel and Subscriptions 24 Quakers Knative Service (ksvc) Noders Knative Service (ksvc)

Slide 24

Slide 24 text

CONFIDENTIAL designator V0000000 Channel and Subscriptions 26

Slide 25

Slide 25 text

CONFIDENTIAL designator V0000000 Channel and Subscriptions 27 Well, I can help. We’ll use a Broker and Triggers. But we have wrong tags.

Slide 26

Slide 26 text

CONFIDENTIAL designator V0000000 Brokers and Triggers 28 Quakers Knative Service (ksvc) Noders Knative Service (ksvc)

Slide 27

Slide 27 text

CONFIDENTIAL designator V0000000 Brokers and Triggers 30

Slide 28

Slide 28 text

CONFIDENTIAL designator V0000000 Traffic Distribution 31 Noders keep Noders clan should keep 80% of Vibranium. To Wakanda 20% of the Vibranium should be sent to Wakanda. 80% 20%

Slide 29

Slide 29 text

CONFIDENTIAL designator V0000000 Traffic Distribution 32 Ok. Let’s do some traffic distribution!

Slide 30

Slide 30 text

CONFIDENTIAL designator V0000000 The End 34

Slide 31

Slide 31 text

CONFIDENTIAL designator V0000000 Resources 35 https://bit.ly/rh-functionia

Slide 32

Slide 32 text

CONFIDENTIAL designator V0000000 linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat 36 Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you