Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Camel K and Serverless in Action

Camel K and Serverless in Action

When to use them As organizations move workloads to containers and the cloud the need to utilize resources optimally is ever important. Serverless technology allows dynamic allocation of resources as needed ensuring no under or over provisioning. This is particularly useful for workloads that run periodically or see spikes. Apache Camel is a widely used Java integration framework that in the latest major version begins to utilize serverless technology. In this session, attendees will get an introduction to serverless technology and Apache Camel. They will learn how Camel K utilizes it to run natively on Kubernetes platforms as well as how to get started with the technologies. Attendees will also see a live demo of Camel K and serverless in action.

YouTube: https://youtu.be/6BlLPUP0eJE

Red Hat Livestreaming

April 20, 2021
Tweet

More Decks by Red Hat Livestreaming

Other Decks in Technology

Transcript

  1. 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.
  2. Integration Patterns Split orders Send each order to it’s process

    service Electronics Others Aggregator Normalizer Content Enricher Resequencer
  3. 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
  4. 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.”
  5. 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”
  6. 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
  7. 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.
  8. 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
  9. 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)
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 25 Knative Serving Eventing Knative defines building blocks for “Serverless”

    applications <<custom-resource>> Service Scale-to-zero and request-driven compute <<custom-resource>> Service <<custom-resource>> Service Event binding and delivery for messaging style integration <<custom-resource>> Channel <<custom-resource>> Channel <<custom-resource>> Channel A building block is a CRD with a controller (or “operator”) that manages its lifecycle
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. Event Driven + Serverless Serverless f( ) Microservice OpenShift KNative

    Streams, AMQ Broker Camel K Quarkus Event Driven
  22. 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