Cloud native Camel riding with
Kubernetes and OpenShift
Christian Posta
Principal Middleware Specialist/Architect
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: christian@redhat.com
•  Committer on Apache Camel, Apache ActiveMQ, Fabric8
•  Worked with largest Microservices, web-scale, unicorn companies
•  Blogger, speaker about DevOps, integration, and microservices
•  Currently writing “Microservices for Java developers” for
O’Reilly (June 2016)
Cloud Native Architectures
Cloud Native Architectures
If	change	is	happening	on	the	outside		
faster	than	on	the	inside	the	end	is	in	sight.	
Jack Welch, former CEO, GE
Cloud Native Architectures
S&P company life expectancy
Cloud Native Architectures
Source: Dave Gray, The Connected Company
Source: Dave Gray, The Connected Company
•  Trying to incorporate new technology?
•  Trying to copy what others (Netflix, Amazon) are
doing?
•  Tactical automation?
•  Created a “DevOps” team?
•  Exploring cloud services?
•  Build/deploy automation?
•  OpenSource?
•  Piecemeal integration?
How are you keeping up with change?
Cloud Native Architectures
Cloud Native Architectures
•  Faster software delivery
•  Own database (data)
•  Faster innovation
•  Scalability
•  Right technology for the
problem
•  Test individual services
•  Isolation
•  Individual deployments
Microservices helps solve the problem of
“how do we decouple our services and
teams to move quickly at scale to
deliver business value”
Cloud Native Architectures
Microservices Envy:
http://www.thoughtworks.com/radar/techniques/microservice-envy
You’re not going to do microservices
http://christianposta.com/blog/not-gonna-happen
•  If my services are isolated at the process
level, I’m doing #microservices
I’m doing microservices if…
•  If I use REST/Thrift/ProtoBuf instead of
SOAP, I’m doing #microservices
•  If I use JSON, I’m doing #microservices
•  If I use Docker / SpringBoot / Dropwizard /
embedded Jetty, I’m doing #microservices
People	try	to	copy	Net7lix,	but	they	can	only		
copy	what	they	see.	They	copy	the		
results,	not	the	process.	
Adrian Cockcroft, former Chief Cloud Architect, Netflix
Call	it	what	you	want;	SOA,	microservices	–		
it’s	all	just	distributed	systems	
Christian Posta – Red Hat
Cloud Native Architectures
Cloud Native Architectures
Cloud Native Architectures
Fallacies of distributed computing
•  Reliable networking
•  Latency is zero
•  Bandwidth is infinite
•  Network is secure
•  Topology doesn’t change
•  Single administrator
•  Transport cost is zero
•  Network is homogenous
https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
Cloud Native Architectures
If we have to take into account the network,
do we still need integration?
Cloud Native Architectures
We’ll just do reactive, event-driven
distributed systems… still need integration?
Cloud Native Architectures
Yes; we need reliable integration!
•  REST, RPC
•  Messaging (ActiveMQ, JMS, AMQP, STOMP, Kafka, etc)
•  Legacy (SOAP, mainframe, file processing, proprietary)
•  Managed file processing
•  Streaming
•  Message transformation
•  EIPs
Heavy Lifting: Camel for Microservices
Cloud Native Architectures
Apache Camel to the rescue!
•  Small Java library
•  Distributed-system swiss-army knife!
•  Powerful EIPs
•  Declarative DSL
•  Embeddable into any JVM (EAP, Karaf, Tomcat, Spring
Boot, Dropwizard, Wildfly Swarm, no container, etc)
•  Very popular (200+ components for “dumb pipes”)
Real developers ride Camels!
Cloud Native Architectures
Apache Camel to the rescue!
•  Automatic retries, backoff algorithms
•  Dynamic routing
•  Powerful testing/mocking framework
•  Circuit breakers
•  Backpressure mechanisms
•  Beautiful REST DSL with built in Swagger support
•  “Smart endpoints, dumb pipes”
•  Endpoint does one thing well
•  Metadata used for further routing
•  Really “dynamic” with rules engine (eg,
Drools/BRMS)
Dynamic Routing
REST DSL
public class OrderProcessorRouteBuilder extends RouteBuilder {	
	
@Override	
public void configure() throws Exception {	
	
rest().post(“/order/socks”)	
	.description(“New Order for pair of socks”)	
	.consumes(“application/json”)	
	.route()	
	 	.to(“activemq:topic:newOrder”)	
	 .log(“received new order ${body.orderId}”)	
.to(“ibatis:storeOrder?statementType=Insert”);	
}	
}
•  Throttle EIP
•  http://camel.apache.org/throttler.html
•  Blocking SEDA Queue
•  from(“seda:name?size=100&blockWhenFull=true)
•  Configure jetty/netty to use blocking acceptor
queues
•  https://wiki.eclipse.org/Jetty/Howto/High_Load
•  Using Exception handling/retry and DLQ
logic when getting flow controlled
•  http://camel.apache.org/error-handling-in-camel.html
Backpressure with Camel
Circuit breaker
public class OrderProcessorRouteBuilder extends RouteBuilder {	
	
@Override	
public void configure() throws Exception {	
	
from(“direct:someinterface”)	
	.loadbalance()	
	.circuitBreaker(3, 20000L, MyException.class)	
	.to(“ibatis:storeOrder?statementType=Insert”);	
}	
}
Cloud Native Architectures
Quick Demo?
Cloud Native Architectures
Cloud Native Architectures
Typical problems developing microservices
•  How to run them all locally?
•  How to package them (dependency management)
•  How to test?
•  Vagrant? VirtualBox? VMs?
•  Specify configuration
•  Process isolation
•  Service discovery
•  Multiple versions?
Cloud Native Architectures
Shared infrastructure platforms headaches
•  Different teams
•  Different rates of change
•  VM sprawl
•  Configuration drift
•  Isolation / multi-tenancy
•  Performance
•  Real-time vs batch
•  Compliance
•  Security
•  Technology choices
Cloud Native Architectures
Reasonable solutions
•  Automate, automate, automate
•  Duct tape, shoe string, bungee cords
•  Rely on templates, versioning, scm
•  Fuse Fabric
Cloud Native Architectures
Immutable infrastructure/deploys
•  “we’ll just put it back in Ansible”
•  Avoid chucking binaries / configs together and hope!
•  Cattle vs Pets
•  Don’t change it; replace it
•  System created fully from automation; avoid drift
•  Eliminate manual configuration/intervention
Docker / Linux Containers
Kubernetes
•  Developer focused workflow
•  Enterprise ready
•  Higher level abstraction above containers for
delivering technology and business value
•  Build/deployment triggers
•  Software Defined Networking (SDN)
•  Docker native format/packaging
•  CLI/Web based tooling
OpenShift
Red Hat OpenShift
Public
PaaS
Service
On-premise
or Private
PaaS
Software
Open
Source
PaaS
Project
Cloud Native Architectures
RED HAT JBOSS FUSE
Development and tooling
Develop, test, debug, refine,
deploy
JBoss Developer Studio
Web services framework
Web services standards, SOAP, XML/
HTTP, RESTful HTTP
Integration framework
Transformation, mediation, enterprise
integration patterns
Management and
monitoring
System and web services metrics,
automated discovery, container
status, automatic updates
JBoss Operations Network
+
JBoss Fabric Management
Console
(hawtio)
Apache CXF Apache Camel
Reliable Messaging
JMS/STOMP/NMS/MQTT, publishing-subscribe/point-2-point, store and forward
Apache ActiveMQ
Container
Life cycle management, resource management, dynamic deployment,
security and provisioning
Apache Karaf + Fuse Fabric
RED HAT ENTERPRISE LINUX
Windows, UNIX, and other Linux
44
Enterprise Service Bus?
Cloud Native Architectures
Fuse Integration Services for OpenShift
•  Set of tools for integration developers
•  Build/package your Fuse/Camel services as Docker
images
•  Run locally on CDK
•  Deploy on top of OpenShift
•  Plugs-in to your existing build/release ecosystem
(Jenkins/Maven/Nexus/Gitlab,etc)
Cloud Native Architectures
Fuse Integration Services for OpenShift
•  Manage them with Kubernetes/OpenShift
•  Flat class loader JVMs
•  Take advantage of existing investment into Karaf with
additional options like “just enough app server”
deployments
•  Supports Spring, CDI, Blueprint
Cloud Native Architectures
Cloud Native Architectures
Using FIS on Red Hat CDK
•  Small VM run locally by developers
•  Full access to Docker, Kubernetes, OpenShift
•  Deploy your suite of microservices with ease!
•  Uses Vagrant/VirtualBox
•  Getting Started on Windows! http://bit.ly/1U5xU4z
Cloud Native Architectures
Typical problems developing microservices
•  How to run them all locally?
•  How to package them
•  How to test?
•  Vagrant? VirtualBox? VMs?
•  Specify configuration
•  Process isolation
•  Service discovery
•  Multiple versions?
Cloud Native Architectures
Cloud Native Architectures
Cloud Native Architectures
5 min demo
Cloud Native Architectures
What’s included in FIS?
•  Docker base images
•  Source to Image base images
•  Archetypes for new-project creation
•  Maven plugins
•  AMQ discovery (within OpenShift) plugin
•  HawtIO based camel tooling for web-based JVM/Camel
introspection/visualization
Cloud Native Architectures
Quick Demo?
•  Trying to incorporate new technology?
•  Trying to copy what others (Netflix, Amazon) are
doing?
•  Tactical automation?
•  Created a “DevOps” team?
•  Exploring cloud services?
•  Build/deploy automation?
•  OpenSource?
•  Piecemeal integration?
How are you keeping up with change?
Cloud Native Architectures
•  100% open source, ASL 2.0
•  Technology agnostic (java, nodejs, python,
golang, etc)
•  Built upon decades of industry practices
•  1-click automation
•  Cloud native (on premise, public cloud, hybrid)
•  Complex build/deploy pipelines (human
workflows, approvals, chatops, etc)
•  Comprehensive integration inside/outside the
platform
What if you could do all of this right now
with an open-source platform?
•  Docker native, built on top of Kubernetes API
•  Out of the box CI/CD, management UI
•  Logging, Metrics
•  ChatOps
•  API Management
•  iPaaS/Integration
•  Chaos Monkey
•  Lots and lots of tooling/libraries to make
developing cloud-native applications easier
http://fabric8.io
Christian Posta
Principal Middleware Specialist/Architect
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: christian@redhat.com
Questions
and
Discussion

Cloud Native Camel Riding

  • 1.
    Cloud native Camelriding with Kubernetes and OpenShift
  • 2.
    Christian Posta Principal MiddlewareSpecialist/Architect Twitter: @christianposta Blog: http://blog.christianposta.com Email: christian@redhat.com •  Committer on Apache Camel, Apache ActiveMQ, Fabric8 •  Worked with largest Microservices, web-scale, unicorn companies •  Blogger, speaker about DevOps, integration, and microservices •  Currently writing “Microservices for Java developers” for O’Reilly (June 2016) Cloud Native Architectures
  • 3.
  • 4.
  • 5.
    Cloud Native Architectures Source:Dave Gray, The Connected Company
  • 6.
    Source: Dave Gray,The Connected Company
  • 7.
    •  Trying toincorporate new technology? •  Trying to copy what others (Netflix, Amazon) are doing? •  Tactical automation? •  Created a “DevOps” team? •  Exploring cloud services? •  Build/deploy automation? •  OpenSource? •  Piecemeal integration? How are you keeping up with change? Cloud Native Architectures
  • 8.
    Cloud Native Architectures • Faster software delivery •  Own database (data) •  Faster innovation •  Scalability •  Right technology for the problem •  Test individual services •  Isolation •  Individual deployments
  • 9.
    Microservices helps solvethe problem of “how do we decouple our services and teams to move quickly at scale to deliver business value” Cloud Native Architectures
  • 10.
    Microservices Envy: http://www.thoughtworks.com/radar/techniques/microservice-envy You’re notgoing to do microservices http://christianposta.com/blog/not-gonna-happen
  • 11.
    •  If myservices are isolated at the process level, I’m doing #microservices I’m doing microservices if… •  If I use REST/Thrift/ProtoBuf instead of SOAP, I’m doing #microservices •  If I use JSON, I’m doing #microservices •  If I use Docker / SpringBoot / Dropwizard / embedded Jetty, I’m doing #microservices
  • 12.
  • 14.
  • 15.
  • 16.
    Cloud Native Architectures Fallaciesof distributed computing •  Reliable networking •  Latency is zero •  Bandwidth is infinite •  Network is secure •  Topology doesn’t change •  Single administrator •  Transport cost is zero •  Network is homogenous https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
  • 17.
    Cloud Native Architectures Ifwe have to take into account the network, do we still need integration?
  • 18.
    Cloud Native Architectures We’lljust do reactive, event-driven distributed systems… still need integration?
  • 19.
    Cloud Native Architectures Yes;we need reliable integration! •  REST, RPC •  Messaging (ActiveMQ, JMS, AMQP, STOMP, Kafka, etc) •  Legacy (SOAP, mainframe, file processing, proprietary) •  Managed file processing •  Streaming •  Message transformation •  EIPs
  • 20.
    Heavy Lifting: Camelfor Microservices
  • 21.
    Cloud Native Architectures ApacheCamel to the rescue! •  Small Java library •  Distributed-system swiss-army knife! •  Powerful EIPs •  Declarative DSL •  Embeddable into any JVM (EAP, Karaf, Tomcat, Spring Boot, Dropwizard, Wildfly Swarm, no container, etc) •  Very popular (200+ components for “dumb pipes”)
  • 22.
  • 23.
    Cloud Native Architectures ApacheCamel to the rescue! •  Automatic retries, backoff algorithms •  Dynamic routing •  Powerful testing/mocking framework •  Circuit breakers •  Backpressure mechanisms •  Beautiful REST DSL with built in Swagger support
  • 24.
    •  “Smart endpoints,dumb pipes” •  Endpoint does one thing well •  Metadata used for further routing •  Really “dynamic” with rules engine (eg, Drools/BRMS) Dynamic Routing
  • 25.
    REST DSL public classOrderProcessorRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { rest().post(“/order/socks”) .description(“New Order for pair of socks”) .consumes(“application/json”) .route() .to(“activemq:topic:newOrder”) .log(“received new order ${body.orderId}”) .to(“ibatis:storeOrder?statementType=Insert”); } }
  • 26.
    •  Throttle EIP • http://camel.apache.org/throttler.html •  Blocking SEDA Queue •  from(“seda:name?size=100&blockWhenFull=true) •  Configure jetty/netty to use blocking acceptor queues •  https://wiki.eclipse.org/Jetty/Howto/High_Load •  Using Exception handling/retry and DLQ logic when getting flow controlled •  http://camel.apache.org/error-handling-in-camel.html Backpressure with Camel
  • 27.
    Circuit breaker public classOrderProcessorRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { from(“direct:someinterface”) .loadbalance() .circuitBreaker(3, 20000L, MyException.class) .to(“ibatis:storeOrder?statementType=Insert”); } }
  • 28.
  • 29.
  • 30.
    Cloud Native Architectures Typicalproblems developing microservices •  How to run them all locally? •  How to package them (dependency management) •  How to test? •  Vagrant? VirtualBox? VMs? •  Specify configuration •  Process isolation •  Service discovery •  Multiple versions?
  • 31.
    Cloud Native Architectures Sharedinfrastructure platforms headaches •  Different teams •  Different rates of change •  VM sprawl •  Configuration drift •  Isolation / multi-tenancy •  Performance •  Real-time vs batch •  Compliance •  Security •  Technology choices
  • 32.
    Cloud Native Architectures Reasonablesolutions •  Automate, automate, automate •  Duct tape, shoe string, bungee cords •  Rely on templates, versioning, scm •  Fuse Fabric
  • 34.
    Cloud Native Architectures Immutableinfrastructure/deploys •  “we’ll just put it back in Ansible” •  Avoid chucking binaries / configs together and hope! •  Cattle vs Pets •  Don’t change it; replace it •  System created fully from automation; avoid drift •  Eliminate manual configuration/intervention
  • 35.
    Docker / LinuxContainers
  • 37.
  • 39.
    •  Developer focusedworkflow •  Enterprise ready •  Higher level abstraction above containers for delivering technology and business value •  Build/deployment triggers •  Software Defined Networking (SDN) •  Docker native format/packaging •  CLI/Web based tooling OpenShift
  • 40.
    Red Hat OpenShift Public PaaS Service On-premise orPrivate PaaS Software Open Source PaaS Project
  • 42.
  • 43.
    RED HAT JBOSSFUSE Development and tooling Develop, test, debug, refine, deploy JBoss Developer Studio Web services framework Web services standards, SOAP, XML/ HTTP, RESTful HTTP Integration framework Transformation, mediation, enterprise integration patterns Management and monitoring System and web services metrics, automated discovery, container status, automatic updates JBoss Operations Network + JBoss Fabric Management Console (hawtio) Apache CXF Apache Camel Reliable Messaging JMS/STOMP/NMS/MQTT, publishing-subscribe/point-2-point, store and forward Apache ActiveMQ Container Life cycle management, resource management, dynamic deployment, security and provisioning Apache Karaf + Fuse Fabric RED HAT ENTERPRISE LINUX Windows, UNIX, and other Linux
  • 44.
  • 46.
    Cloud Native Architectures FuseIntegration Services for OpenShift •  Set of tools for integration developers •  Build/package your Fuse/Camel services as Docker images •  Run locally on CDK •  Deploy on top of OpenShift •  Plugs-in to your existing build/release ecosystem (Jenkins/Maven/Nexus/Gitlab,etc)
  • 47.
    Cloud Native Architectures FuseIntegration Services for OpenShift •  Manage them with Kubernetes/OpenShift •  Flat class loader JVMs •  Take advantage of existing investment into Karaf with additional options like “just enough app server” deployments •  Supports Spring, CDI, Blueprint
  • 48.
  • 49.
    Cloud Native Architectures UsingFIS on Red Hat CDK •  Small VM run locally by developers •  Full access to Docker, Kubernetes, OpenShift •  Deploy your suite of microservices with ease! •  Uses Vagrant/VirtualBox •  Getting Started on Windows! http://bit.ly/1U5xU4z
  • 50.
    Cloud Native Architectures Typicalproblems developing microservices •  How to run them all locally? •  How to package them •  How to test? •  Vagrant? VirtualBox? VMs? •  Specify configuration •  Process isolation •  Service discovery •  Multiple versions?
  • 51.
  • 52.
  • 53.
  • 54.
    Cloud Native Architectures What’sincluded in FIS? •  Docker base images •  Source to Image base images •  Archetypes for new-project creation •  Maven plugins •  AMQ discovery (within OpenShift) plugin •  HawtIO based camel tooling for web-based JVM/Camel introspection/visualization
  • 55.
  • 56.
    •  Trying toincorporate new technology? •  Trying to copy what others (Netflix, Amazon) are doing? •  Tactical automation? •  Created a “DevOps” team? •  Exploring cloud services? •  Build/deploy automation? •  OpenSource? •  Piecemeal integration? How are you keeping up with change? Cloud Native Architectures
  • 57.
    •  100% opensource, ASL 2.0 •  Technology agnostic (java, nodejs, python, golang, etc) •  Built upon decades of industry practices •  1-click automation •  Cloud native (on premise, public cloud, hybrid) •  Complex build/deploy pipelines (human workflows, approvals, chatops, etc) •  Comprehensive integration inside/outside the platform What if you could do all of this right now with an open-source platform?
  • 60.
    •  Docker native,built on top of Kubernetes API •  Out of the box CI/CD, management UI •  Logging, Metrics •  ChatOps •  API Management •  iPaaS/Integration •  Chaos Monkey •  Lots and lots of tooling/libraries to make developing cloud-native applications easier http://fabric8.io
  • 63.
    Christian Posta Principal MiddlewareSpecialist/Architect Twitter: @christianposta Blog: http://blog.christianposta.com Email: christian@redhat.com Questions and Discussion