Event-driven serverless applications really rock these days. Knative and Kubernetes offer nice primitives for creating them, but if you've ever tried going beyond the "Hello World" example, you know that writing real-life applications is much harder than expected. The more your application is deconstructed into smaller pieces, the more you need better communication patterns for managing all the inherent complexity. Here comes Camel K, a lightweight integration tool created specifically to address these issues. Camel K allows you to declaratively orchestrate events in a serverless environment using a beautiful language. It allows you to connect functions and services to any kind of external data source or sink, from enterprise services to cloud services or SaaS. It’s based on Apache Camel, the most powerful open source integration framework, and it leverages Knative to deliver integration patterns in a serverless way, allowing you to effectively create real-life serverless applications. We will show how Camel K works under the hood and, with coding examples, we’ll also demonstrate how Camel K makes it easy to connect (almost) anything using integration patterns and the 300+ components that Apache Camel provides.
2. Agenda
2
● What is Apache Camel (and Camel K)?
● Camel K in the serverless space
● Demo
● Future developments
3. About us
3
Luca Burgazzoli
Principal Architect at Red Hat
Twitter: @lburgazzoli
We work on:
- Apache Camel and Camel K
- Red Hat Integration
- Knative Contrib
Nicola Ferraro
Principal Software Engineer at Red Hat
Twitter: @ni_ferraro
5. … when you’re free to play!
We all love
microservices!
We are the
best team in
the world!
Software development is fun…
My
App
Let’s do it
serverless!
6. But then you realize...
… that you’re not alone in the world!
My
App
7. You need to solve a lot of problems:
● Different communication models (e.g. sync / async)
● Different protocols or messaging systems
● Different languages or technologies
● Different business domains
● Different data access patterns
● …
● What if your app is unavailable?
● How do we manage consistency?
Even with only two systems...
My
App
Your
App
I WAS A SHEEP
RANCHER
BEFORE I
WORKED HERE
● Different life philosophy
● Inability to change the other
side
● ...
8. If we had the perfect tool to deal with integration...
?
That could connect to
any almost any system
With support for known
integration patterns
That can work on and
off the cloud
That can integrate with
a simple language
from(“kafka:topic”)
.to(“grpc:endpoint”)
This is
Apache Camel
9. Apache Camel can set you free!
My
App
Your
App
from(“pulsar://company/nsx/topic1”)
.unmarshal().json()
.transform().simple(“${body[data]}”)
.to(“knative:event/activity”)
from(“knative:event/produced”)
.pollEnrich()
.simple(“aws2-s3://mybucket/files/${header.Ce-File}”)
.to(“kafka:ext-topic”)
Party Area
(Free lunch zone ®)
10. Apache Camel as of 2019/2020
● One of the most active Apache projects
● Several components contributed by the community
○ We have 329 346 components today
+40% New Users (users@camel.apache.org and StackOverflow)
+5 New Committers and PMC members
+4 New awesome sub-projects
(Camel K, Camel Quarkus, Camel Kafka Connect, Camel Spring-Boot)
Community is
what makes
Camel different
It does not look
11 years “old” ;)
12. Camel K
● https://github.com/apache/camel-k
● A platform for directly running integrations on Openshift and Kubernetes
● Reached version 1.0.0 on June 9, 2020
What is Apache Camel K?
12
A lightweight integration platform, born on
Kubernetes, with serverless superpowers
13. Camel K13
Camel K for Developers
13
Create
integration file
from(“knative:channel/xxxx”)
.transform()...
.to(“kafka:topic”)
1
EXECUTE
CLI Tools
$ kamel run integration.java
2
RUNNING
Serverlesson
OpenShift/Kubernetes
3
14. Camel K14
Camel K Architecture
Knative
Kubernetes/OpenShift
Camel K Operator
DEVELOPER
Serverless
Function/Application
Pod
Serverless
Function/Application
Pod
Serverless
Function/Application
Pod
Tailored for cloud-native development
experience.
● Live coding on cloud
● Built-in dependency management
● Rapid deployment, incremental
updates
● Automate cloud resource generation
● Highly customizable
Integration
Custom Resource
LIVEUPDATE!!
15. Camel K15
Camel K Operator
CAMEL K
OPERATOR
● Choose a runtime
○ Java main
○ Quarkus
● Scaffold a project
● Add boilerplate
○ Container behaviour
○ Serverless behaviour
○ Monitoring setup …
● Add dependencies
● Create container image
○ Incremental updates
● Create OpenShift and Knative resources for
deployment
○ Secrets
○ Service
○ Config Map
○ Deployment
○ Ingress
19. Camel K loves Knative
A lightweight integration platform, born on
Kubernetes, with serverless superpowers
Not the official
logo, but we like it!
Camel K can also live without Knative, but it doesn’t want to ;)
21. Knative
Service
POD
Scale Down to Zero
Request
Initiate and Start
Scale Up with Load
Knative Serving
Request
Request
Request
Request
POD
POD
POD
POD
23. Knative Eventing
Event Source
kn source
kn source create
kn source list
kn source list-types
Broker
New
Event
Trigger
kn trigger
Kn trigger create
kn trigger delete
kn trigger list
kn broker
Kn broker create
kn broker delete
kn broker list
Provider
kn service
kn service create
kn service delete
kn service describe
kn service list
kn service update
Event Providers
Infrastructure
New Customer
created event
Email service
Log service
Loyalty points
service
Trigger
Trigger
New
Event
New
Event
FEW Providers
24. Knative Eventing with Camel K
Event Source
Broker
New
Event
Camel K
Provider
Event Providers
Infrastructure
New Customer
created event
Email service
Log service
Loyalty points
service
New
Event
New
Event
300+ components!
Camel K
300+ components!
kamel run
kamel list
kamel delete
kamel run
kamel list
kamel delete
kn trigger
Kn trigger create
kn trigger delete
kn trigger list
Trigger
25. Knative Camel Sources
<< Custom Resource >>
kind: Integration
apiVersion:
camel.apache.org/v1
1
POD
POD
POD
POD
POD
For sources, users can choose to
deploy Knative CamelSources or
Apache Camel K Integrations
<< Custom Resource >>
kind: CamelSource
apiVersion:
sources.knative.dev/v1alpha1
Wraps...
kn source list ...
2
https://knative.dev/docs/eventing/samples/apache-camel-source/
30. POD
Quarkus
Currently, integrations can run on Quarkus in JVM mode:
POD POD
from(“knative:event/produced”)
.pollEnrich()
.simple(“aws2-s3://mybucket/files/${header.Ce-File}”)
.to(“kafka:ext-topic”)
The future is native,
with no changes in ux,
and much better
performance!
Have you heard
about GraalVM
and Mandrel?
https://github.com/apache/camel-quarkus
31. Kamelets
Meaning: Kamel route snippets
Non-camel users find it difficult to write Camel DSL, they just want to leverage it.
… … … …
1. Pick one
2. Configure parameters
3. Choose destination
query=quarkus
token=...
Kamelets have many more use cases outside Knative:
● Camel Kafka Connect
● Visual Tools for Camel K development
Kamelet Catalog (Kubernetes Objects)
32. Camel K
Testing software using BDD style.
Now part of citrusframework.org.
Same structure of Camel K (CLI + operator)
To run the test:
yaks test gateway.feature
https://github.com/citrusframework/yaks
Feature: API Gateway Works
Background:
Given URL: https://myservice/api/films
Scenario: Get a result from API
When send GET /
Then receive HTTP 200 OK
YAKS
33. Other important future developments
● Webhooks: reduce the amount of components that need an “always on” pod
● Keda: autoscaling not only limited to http workloads
34. Camel K
Want to learn more about Camel?
What’s new with Apache Camel 3? | DevNation Tech Talk
https://developers.redhat.com/devnation/tech-talks/apache-camel-3/
By Andrea Cosentino and Claus Ibsen
Kubernetes enterprise integration patterns with Camel-K | DevNation Tech Talk
https://developers.redhat.com/videos/youtube/51x9BewGCYA/
By Luca Burgazzoli and Nicola Ferraro
35. Thank you!
If you like Camel K:
1) Use it!
2) Contribute!
(We love any contribution!)
https://github.com/apache/camel-k
Follow us on Twitter:
@ni_ferraro
@lburgazzoli