This document discusses microservices with Apache Camel and fabric8 on Kubernetes. It begins with a quick Apache Camel demo of a Twitter search application built with Camel. It then provides an overview of Kubernetes and fabric8, including key concepts like pods, replication controllers, services, and labels. The remainder discusses developing and deploying Java microservices to Kubernetes using Camel, CDI, fabric8, and the OpenShift CLI for tasks like deployment, scaling, and viewing logs.
3. Claus Ibsen
• Principal Software Engineer
at Red Hat
• Apache Camel
8 years working with Camel
• Author of
Camel in Action books
@davsclaus
davsclaus
davsclaus.com
4. Agenda
• Quick Apache Camel Demo
• Kubernetes and fabric8
• Java Microservices with Kubernetes
• More Information
21. Kubernetes
‣ Open Source orchestration platform for Docker
containers
• Rewrite of Google’s internal framework “Borg”
‣ Declarative specification of a desired state
‣ Self-healing
‣ Service discovery
‣ Scheduling across hosts
‣ Replication
23. Concepts
‣Pods
• Collection of one or more Docker containers
‣Replication Controller
• Creates and takes care of Pods
‣Services
• Proxy for a collection of Pods
‣Labels
• Grouping and organization of Objects
‣Namespaces
• Virtual clusters backend by same physical cluster
24. Pod
‣ Collection of Docker containers running on the same
host.
‣ Pods have unique IPs
‣ Containers in a Pod ….
• …. share the same IP address
• …. can reach each other via local ports
• …. can share data via volumes
‣ Pods can have one or more Labels
25. Replication Controller
‣ Controls Pods selected by Labels
‣ Ensures that a specified number of Pod replicas is
running
‣ Holds Pod templates for creating new Pods
‣ Autoscaling
‣ Rolling Updates
26. Service
‣ View on a set of Pods with single
IP address and port
‣ Pods are selected by Label
‣ Services are referenced by
environment variables
‣ Service addresses stay stable
• Pods come and go (with different IPs)
27.
28. fabric8
‣ Tools and Services for value add to Kubernetes and
OpenShift
• Management: console, logging, metrics, dashboards, …
• Continuous Delivery Workflow
• iPaaS: Camel route visualization, API registry, Messaging as
a Service, …
• Tools: Kubernetes/OpenShift build integration, Kubernetes
component test support, CDI extensions
• Quickstarts: Ready to use examples, also available as
Maven archetypes
29. Agenda
• Apache Camel Introduction
• Kubernetes and fabric8
• Java Microservices with Kubernetes
• More Information
43. Our Demo
Camel CDI Apache Tomcat
HTTP 8080
from timer
to http
to log
from servlet
transform
helloservice
44. Static vs Dynamic Platform
Camel CDI Apache Tomcat
HTTP 8080
from timer
to http
to log
from servlet
transform
helloservice
Hardcoded
hostname and port
51. Using Kubernetes
Service
• Environment Variables
• Hostname
• Port
Camel CDI
from timer
to http
to log
Service Discovery using DNS is available
in newer versions of Kubernetes.