Cloud Native Camel Design Patterns
(Tips for Running Apache Camel on Kubernetes)
ApacheCon Europe November 2016 Bilgin Ibryam
Cloud Native Camel Design Patterns (Tips for Running Apache Camel - - PowerPoint PPT Presentation
Cloud Native Camel Design Patterns (Tips for Running Apache Camel on Kubernetes) ApacheCon Europe November 2016 Bilgin Ibryam Bilgin Ibryam Twitter: @bibryam Email: bibryam@gmail.com Blog: http://ofbizian.com LinkedIn:
ApacheCon Europe November 2016 Bilgin Ibryam
Cloud Native Camel Design Patterns 2
Cloud Native Camel Design Patterns 3
Cloud Native Camel Design Patterns 4
And these trends do affect the way we design, develop and run Camel applications!
Cloud Native Camel Design Patterns 5
Cloud Native Camel Design Patterns 6
Container Orchestration Wars - by Karl Isenberg http://bit.ly/kube-war
Scheduling
Resource Management
Service Management
Cloud Native Camel Design Patterns 7
Cloud Native Camel Design Patterns 8
four times those of nearest rival Mesos.
Cloud Native Camel Design Patterns 9
Cloud Native Camel Design Patterns 10
Cloud Native Camel Design Patterns 11
Cloud Native Camel Design Patterns 12
Service only packaging
Service and Runtime packaging - .zip
Cloud Native Camel Design Patterns 13
Cloud Native Camel Design Patterns 14
Goal Description docker:start Create and start containers docker:stop Stop and destroy containers docker:build Build images docker:watch Watch for doing rebuilds and restarts docker:push Push images to a registry docker:remove Remove images from local docker host docker:logs Show container logs docker:source Attach docker build archive to Maven project
Start Kubernetes: mvn fabric8:cluster-start Build (artifacts and docker image): mvn clean install docker:build Deploy a service to Kubernetes: mvn fabric8:json fabric8:apply Different workfmows:
➔
Alexec (92*), Wouterd(77*), spotify(735*)
➔
Fabric8 maven docker plugin (472*)
Fabric8 docker-maven-plugin goals
Cloud Native Camel Design Patterns 15
Cloud Native Camel Design Patterns 16
mvn fabric8:json fabric8:apply
Cloud Native Camel Design Patterns 17
Cloud Native Camel Design Patterns 18
➔ HTTP Health Checks – expects return code between 200-399 ➔ Container Exec – expects return code 0 ➔ TCP Socket – expects to open socket connection
Cloud Native Camel Design Patterns 19
Cloud Native Camel Design Patterns 20
➔
Has the same formats as livenessProbe/readinessProbe and has “at least once” guarantee.
Cloud Native Camel Design Patterns 21
The bad news: you have externalize everything that is environment specifjc. The good news: there is less things to externalize.
Cloud Native Camel Design Patterns 22
Cloud Native Camel Design Patterns 23
Cloud Native Camel Design Patterns 24
Cloud Native Camel Design Patterns 25
idempotent consumer and aggregator are stateful EIPs!
message priority, virtual topics
Cloud Native Camel Design Patterns 26
JVM based:
Camel based:
Forget about all of these options, and create a Kubernetes pod with 1 replica.
Cloud Native Camel Design Patterns 27
Cloud Native Camel Design Patterns 28
Sample topological levels: region (affjnity) → zone (affjnity) → rack (anti-affjnity)
Cloud Native Camel Design Patterns 29
Cloud Native Camel Design Patterns 30
Cloud Native Camel Design Patterns 31
Cloud Native Camel Design Patterns 32
Cloud Native Camel Design Patterns 33
Distributed Idempotent Filters:
Cloud Native Camel Design Patterns 34
Cloud Native Camel Design Patterns 35
Recipient List, Splitter, Threads, Throttler, Wire Tap, Polling Consumer, ProducerTemplate, and OnCompletion, Circuit Breaker, Async Error Handler.
Cloud Native Camel Design Patterns 36
Cloud Native Camel Design Patterns 37
Cloud Native Camel Design Patterns 38
Cloud Native Camel Design Patterns 39
Cloud Native Camel Design Patterns 40
Camel batch support :
Limitations:
monitoring, metrics, logs aggregation agents and clustering solution.
and locking.
Cloud Native Camel Design Patterns 41
Features
Prerequisites
Cloud Native Camel Design Patterns 42
Cloud Native Camel Design Patterns 43
Cloud Native Camel Design Patterns 44
Less Relevant (or provided by the platform) Not Changed (still relevant) More Important (or a new concern) Canonical Data Model Load Leveling Bounded Context Distributed/Global Transactions Bulkhead, Error Channel Saga, Compensating Transactions Batch Job on JVM, Singleton Service on JVM Parallel Pipeline Circuit Breaker,
CQRS Load Balancing on JVM
Runtime Reconfjguration, External Confjguration
Service Instance, External Confjguration
Service Discovery on JVM VETRO Tracing, Health Check Service Consolidation Data Integrity Policy Driven Scheduling Reusable Route Monitoring Retry, Idempotent Filter
Cloud Native Camel Design Patterns 45
✔ Kubernetes is awesome. ✔ Kubernetes is the best place to run Apache Camel applications. ✔ With Kubernetes there are less concerns for developers to worry about. ✔ You need to write even more resilient and scalable services now. ✔ Don't reinvent the wheel, use Fabric8 Cloud Native tooling.
@bibryam
Kubernetes http://kubernetes.io/ Fabric8 https://fabric8.io/ Camel Design Patterns http://bit.ly/camel-patterns/