Slide 1

Slide 1 text

Mary Cochran Camel K and Serverless Senior App Dev Solutions Architect

Slide 2

Slide 2 text

Camel OpenShift Commons

Slide 3

Slide 3 text

3 PATTERN BASED INTEGRATION 300 COMPONENTS Batch, messaging, web services, cloud, APIs, and more ... BUILT-IN DATA TRANSFORMATION JSON, XML, HL7, YAML, SOAP, Java, CSV, and more ... INTUITIVE ROUTING Develop integrations quickly in Java or XML. ENTERPRISE INTEGRATION PATTERNS Build integrations using enterprise best practices. Create, connect, and compose APIs with ease. NATIVE REST SUPPORT Apache Camel, a powerful pattern-based integration engine with a comprehensive set of connectors and data formats to tackle any integration problem.

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Integration Patterns Split orders Send each order to it’s process service Electronics Others Aggregator Normalizer Content Enricher Resequencer

Slide 6

Slide 6 text

Camel Routes from("file:data/inbox") .to("jms:queue:order"); Java DSL XML DSL

Slide 7

Slide 7 text

7 from("file:inbox") .split(body().tokenize("\n")) .marshal(customToXml) .to("activemq:queue:line");

Slide 8

Slide 8 text

Quarkus OpenShift Commons

Slide 9

Slide 9 text

Differentiators 9 Live coding Unified configuration Developer joy Over 90 extensions “Powered by Quarkus” applications Best of breed libraries and standards Tailors your app for HotSpot & GraalVM Fast boot time and low RSS memory Serverless fit Container first Combines blocking and non-blocking Built-in event bus Unifies imperative and reactive “Quarkus has introduced a new paradigm that puts things upside down on the way things are run under the covers - supporting native, all reflection done at compile time and not runtime is just amazing!” - Talkdesk Compared to traditional Java stack ● 1/10 RAM usage ● 300x faster startup time

Slide 10

Slide 10 text

10 A cohesive platform for optimized developer joy: ● Based on standards and more ● Unified configuration ● Live coding ● Streamlined code for the 80% common usages, flexible for the 20% ● No hassle native executable generation Developer Joy “Our developers used to wait 2 to 3 mins to see their changes. Live coding does away with this.”

Slide 11

Slide 11 text

11 Container First REST + CRUD Quarkus + GraalVM 0.055 Seconds Quarkus + OpenJDK 2.5 Seconds Traditional Cloud-Native Stack 9.5 Seconds Time to first response REST + CRUD Quarkus + GraalVM 35 MB Quarkus + OpenJDK 130 MB Traditional Cloud-Native Stack 218 MB “We went from 1-min startup times to 400 milliseconds”

Slide 12

Slide 12 text

Camel K OpenShift Commons

Slide 13

Slide 13 text

13 What is Apache Camel K? A lightweight integration platform based on Apache Camel, born on Kubernetes, with serverless superpowers. Based on operator-sdk A community-driven project A subproject of Apache Camel started on August 31st, 2018 https://github.com/apache/camel-k http://camel.apache.org

Slide 14

Slide 14 text

A lightweight integration platform, based on Apache Camel, born on Kubernetes, with serverless superpowers. What is Apache Camel K ? Runs on “vanilla” Kubernetes (1), Openshift (2) and gives its best on a Knative-powered cluster (3)! K 1. K 2. K 3.

Slide 15

Slide 15 text

15 Source:https://camel.apache.org/projects/ Apache Camel 3 Projects APACHE CAMEL KAFKA CONNECTORS Camel Quarkus Optimized JVM & Native compiled Java (GraalVM) Camel K Camel on Kubernetes & Knative Camel Swiss knife of integration Camel Spring Boot Camel on Spring Boot Camel Karaf Camel on Apache Karaf / OSGi Camel Kafka Connector Kafka Connector with Camel

Slide 16

Slide 16 text

16 Performance Lower is better :)

Slide 17

Slide 17 text

17 What? 1. Create an integration file (Java, Groovy, Kotlin, JS, XML, …) $ kamel run integration.groovy 2. Run it 3. It runs on Kubernetes / OpenShift // Lookup every second the 'www.google.com' domain name and log the output from('timer:dns?period=1s') .routeId('dns') .setHeader('dns.domain') .constant('www.google.com') .to('dns:ip') .log('log:dns'); Camel DSL, based on EIPs... Camel K CLI (optional)

Slide 18

Slide 18 text

18 Architecture Dev Environment Cloud kamel CLI Camel K Operator “Integration” Custom Resource Running Pod Live updates! Fast redeploy! Less than 1 second! Tailored for cloud-native development experience

Slide 19

Slide 19 text

INTERNAL ONLY QUARKUS BOOTCAMP Service Microservice Serverless > Single Purpose > Stateless > Independently Scalable > Automated > Single Action > Ephemeral > Autonomous > Loosely-coupled Architectural Evolution to Serverless f( ) 19

Slide 20

Slide 20 text

kind: Integration apiVersion: camel.apache.org/v1alpha1 metadata: name: my-integration spec: sources: - name: source.groovy content: |- from("knative:channel/a") .to("http:my-host/api/path") from("knative:channel/a") .to("http:my-host/api/path"); Camel K Operator Knative profile? kind: Service apiVersion: serving.knative.dev/v1alpha1 ... yes kind: Deployment # regular one ... no Camel K Knative Profile 20

Slide 21

Slide 21 text

21 Use Cases For Camel K Integration on demand Reusable modules Stream processing Filter, converts and aggregates data Dynamic resizing capabilities Scale up for fluctuations, and 0 to none usage On Demand IoT sensor input Bots Batch Job

Slide 22

Slide 22 text

Demo Camel K OpenShift Commons

Slide 23

Slide 23 text

Serverless and Knative OpenShift Commons

Slide 24

Slide 24 text

24 ● Serverless is an execution model where the code is executed by dynamically allocated resources. ● Serverless removes the need for a traditional always-on server component from the perspective of the developer. ● Knative is an open-source Kubernetes-based platform to deploy and manage serverless workloads. ● Knative is the primary component in Red Hat’s OpenShift Functions product (currently in tech preview). What is Serverless and Knative? https://knative.dev

Slide 25

Slide 25 text

25 Knative Serving Eventing Knative defines building blocks for “Serverless” applications <> Service Scale-to-zero and request-driven compute <> Service <> Service Event binding and delivery for messaging style integration <> Channel <> Channel <> Channel A building block is a CRD with a controller (or “operator”) that manages its lifecycle

Slide 26

Slide 26 text

Install the Operators and Deploy OpenShift Commons

Slide 27

Slide 27 text

27 Kubernetes Namespace There’s no container if no one needs it! rest().post("/path") .to("xx:system1") .to("xx:system2") 300+ components! System 1 System 2 Knative Service Knative Serving

Slide 28

Slide 28 text

28 Kubernetes Namespace A container is created only when needed! rest().post("/path") .to("xx:system1") .to("xx:system2") 300+ components! System 1 System 2 Knative Service Request Pod Knative Serving

Slide 29

Slide 29 text

Kubernetes Namespace rest().post("/path") .to("xx:system1") .to("xx:system2") 300+ components! System 1 System 2 Knative Service Multiple containers under high load! Request Pod Request Request Pod Pod Knative Serving 29

Slide 30

Slide 30 text

30 Serverless Benefits Avoid random, arbitrary prediction Lower operational cost Faster time to market Reduced packaging and deployment complexity Flexible Scalability on-demand Serverless Camel K

Slide 31

Slide 31 text

31 Serverless Operational Benefits With Serverless Over provisioning Time in capacity planning IT cost of idle resources Under provisioning Lost business revenue Poor quality of service More applications Direct line between IT costs & business revenue NOT Serverless with Serverless

Slide 32

Slide 32 text

Event Driven + Serverless Serverless f( ) Microservice OpenShift KNative Streams, AMQ Broker Camel K Quarkus Event Driven

Slide 33

Slide 33 text

Serverless in Action OpenShift Commons

Slide 34

Slide 34 text

linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat 34 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