SlideShare a Scribd company logo
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
Event driven Microservices with
VERT.X & KubernetesAndy Moncsek
Senior Consultant
Andy.Moncsek@trivadis.com
Twitter: @AndyAHCP
Agenda
2 31.08.2016
1. Why?
2. Event driven Microservices
3. VERT.X & Hazelcast
4. Docker & Kubernetes
5. Hazelcast & Kubernetes
6. Demo
Event driven Microservices with VERT.X & Kubernetes
3 31.08.2016
Why?
Event driven Microservices with VERT.X & Kubernetes
Why?
 Developing one Microservice is fun
 Reduced scope
 Choose your technology/language
 Easy to deploy/test
4 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Why?
5 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Typical microservice architecture
Why?
 Developing many Microservices can be a pain
 Complex deployment / orchestration / testing
 Service registry & lookup  latency
 DNS & Load balancer  complex
6 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Why?
 Idea
 Avoid Service registry & lookup
 Decouple services  async + events
 Fast re-/deploy
 And more: resilient,…
7 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
8 31.08.2016
Event driven Microservices
Event driven Microservices with VERT.X & Kubernetes
Event driven microservice
 Asynchronously
 Any number of receivers
 Easy Load Balancing
 Pub/Sub + p2p
 No need for service discovery
9 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Event-driven (micro-)service
10 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
 Traditional way  Message Broker
 No direct request / response
 Broker  single point of failure
Event-driven microservice
11 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
 Using an in-memory data grid
 Automatic node lookup (services)
 Failover
 Shared data  replicated in cluster
 Pub / sub
 Request / response
 NO Service discovery
12 31.08.2016
VERT.X & Hazelcast
Event driven Microservices with VERT.X & Kubernetes
What Vert.x is
is a tool-kit for building reactive
appications on the JVM
13 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
What Vert.x is
14 31.08.2016
scale polyglot
general purposefun
Event driven Microservices with VERT.X & Kubernetes
Verticles
Smallest deployable unit
Scalable
Actor-like
Access to Vertx instance
15 31.08.2016
public class Service extends AbstractVerticle {
public void start() {
this.vertx...
}
public void stop() {
}
}
Event driven Microservices with VERT.X & Kubernetes
Event Loop
Multi-Reactor - event loop
(N threads for N verticles on one instance)
Don’t block the Event-Loop!
Don’t call us, we call you
16 31.08.2016
server.requestHandler(request -> {
request.response().end(„Hello!");
});
Event driven Microservices with VERT.X & Kubernetes
Event Bus (EB)
Nervous system of Vert.x
Communicate
Distributed p2p
Pub/sub
Request-response
17 31.08.2016
EventBus eb = vertx.eventBus();
eb.send(“the.addr", “hello", ar -> {
log.info(ar.result().body());
});
eb.consumer(“the.addr", message -> {
message.reply(“don‘t know");
});
Event driven Microservices with VERT.X & Kubernetes
What is Hazelcast ?
is an In-Memory Data Grid
(and the default cluster provider of Vert.X)
18 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Hazelcast
Open Source & Enterprise Edition
Features:
Distributed Caching & Compute
Clustering
Storage
Management & Security
19 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Hazelcast Clustering
Discover Cluster Members using:
Multicast
TCP
EC2 Cloud
jclouds
20 31.08.2016
Plugins:
AWS
Azure
Kubernetes
Etcd
…
Event driven Microservices with VERT.X & Kubernetes
Run Vert.x inclustered mode
Vert.x default config: multicast
„java –jar service.jar –cluster“
21 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Demo
22 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
23 31.08.2016
Demo
https://github.com/amoAHCP/kube_vertx_demo
Event driven Microservices with VERT.X & Kubernetes
24 31.08.2016
Docker & Kubernetes
Event driven Microservices with VERT.X & Kubernetes
Docker
isolation + automation + inherence + repository + versioning
25 31.08.2016
Ubuntu
image
Java
image
WildFly
image
App
image
Docker alone doesn‘t make you happy ;-)
Event driven Microservices with VERT.X & Kubernetes
Kubernetes
Scale
HA distributed containers
Google starts
>20billion apps/week
Gmail, Web Search, Maps…
26 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Kubernetes
But
It is not trivial
27 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Kubernetes
Service oriented
Services -> machines
“Let users manage
applications, not machines”
28 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Kubernetes
Platform for hosting containers in clusteres
Docker containers across multiple hosts
Provides: monitoring, grouping, load balancing, auto-healing, scaling
Contributors: Google, Redhat, Microsoft, ...
29 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Kubernetes – Key concepts
30 31.08.2016
1. Push Docker image to
Registry
2. Create service
3. Create Controller
4. (Scale Pods)
Event driven Microservices with VERT.X & Kubernetes
Kubernetes Pods
Group of containers
Same network / namespace / IP
Environmental variables
Shared volumes
31 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Kubernetes Controller
Ensure X pods are running
Pod templates
Rolling update
32 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Kubernetes Services
Pod discovery
IP per service
Route to pods
selected with labels
Load balancer
33 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
selector:
name: frontend
labels:
name: frontend
labels:
name: frontend
labels:
name: frontend
ports:
-port: 80
targetPort: 8181
IP: 10.3.245.51
IP: 146.148.15.33 (pub.)
Kubernetes – all together
34 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
https://github.com/brendandburns/gcp-live-k8s-
visualizer
35 31.08.2016
Hazelcast & Kubernetes
Event driven Microservices with VERT.X & Kubernetes
Hazelcast & Kubernetes  What we want
Case 1: Lookup all nodes (Verticles) managed by controller
 1 – N pods
 1 – X container
Case 2: Lookup all nodes in a cluster
 N services per cluster
Routing to X pods
36 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Hazelcast & Kubernetes  What we get
37 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
>kubectl scale rc frontend --replicas=5
>kubectl scale rc read --replicas=10
>kubectl scale rc write --replicas=2
Hazelcast & Kubernetes  What we get
Easy scale- up/down of service instances
Failover provided by Kubernetes and Hazelcast
Distributed Event-Bus  each Verticle instance
Replicated shared data
38 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Hazelcast node discovery in Kubernetes
39 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Discover Cluster Members using:
Multicast
TCP
EC2 Cloud
jclouds
Plugins:
AWS
Azure
Kubernetes
Etcd
…
Hazelcast node discovery in Kubernetes
40 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Hazelcast discovery plugin for Kubernetes
Option 1: Kubernetes REST API
Allows discovery by service name
Option 2: DNS Lookup
Enable custom cluster.xml in Vert.X  put to classpath
https://github.com/noctarius/hazelcast-kubernetes-discovery
Hazelcast node discovery in Kubernetes (2)
41 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
 Vertx-service-discovery project (similar to Hazelcast Option 1)
Option: Kubernetes REST API
Allows discovery by label OR by namespace
Enable custom cluster.xml in Vert.X  put to classpath
https://github.com/vert-x3/vertx-service-discovery
Hazelcast node discovery in Kubernetes
42 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
REST API<hazelcast>
<properties>
<!-- at the moment the discovery needs to be activated explicitly -->
<property name="hazelcast.rest.enabled">true</property>
</properties>
…
<discovery-strategy enabled="true"
class=”….HazelcastKubernetesDiscoveryStrategy">
<properties>
<property name="service-name">frontend-verticle</property>
<property name="namespace">default</property>
</properties>
</discovery-strategy>
</hazelcast>
Missing in official Doc. !
• your Service name
• master Service!
• needs a Kubernetes
Service!
Hazelcast.xml / Cluster.xml
Vert.x / Hazelcast node discovery in Kubernetes
43 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
REST API<hazelcast>
<properties>
<!-- at the moment the discovery needs to be activated explicitly -->
<property name="hazelcast.rest.enabled">true</property>
</properties>
…
<discovery-strategy enabled="true"
class=”….HazelcastKubernetesDiscoveryStrategy">
<properties>
<property name="service-label-name">cluster1</property>
<property name="service-label-value">true</property>
<property name="namespace">default</property>
</properties>
</discovery-strategy>
</hazelcast>
Missing in official Doc. !
• Partition your cluster with
labels
• OR find all in namespace
Hazelcast.xml / Cluster.xml
Hazelcast node discovery in Kubernetes
44 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
DNS Lookup
DNS must be enabled in
Kubernetes (kube2sky)!
<hazelcast>
<properties>
<!-- at the moment the discovery needs to be activated explicitly -->
<property name="hazelcast.discovery.enabled">true</property>
</properties>
…
<discovery-strategy enabled="true"
class=”….HazelcastKubernetesDiscoveryStrategy">
<properties>
<property name="service-dns">cluster.local</property>
</properties>
</discovery-strategy>
</hazelcast>
Hazelcast.xml / Cluster.xml
your Service name
OR
DNS_DOMAIN name
(cluster.local  find all
containers)
45 31.08.2016
Demo
Event driven Microservices with VERT.X & Kubernetes
https://github.com/amoAHCP/kube_vertx_demo/tree/dns-resolving
Try this at home
46 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Test Kubernetes in Docker
https://github.com/vyshane/kid
Many other Docker-compose based solutions available
Limitations: no public IP & access to public service
Workaround:
 kubectl get -o yaml service/myService | grep nodePort
 wget http://$(docker-machine ip):nodePort
Conclusion
Vert.x is lightweight, fast and easy to use
typical web-app, microservices, aggregator / bridge, security, integration,
stream-/event-processing
 Kubernetes :
Functional improvement over clustered infrastructure
 easy deploy, update and scale of applications
47 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
Thank you
Andy Moncsek
Senior Consultant
Andy.Moncsek@trivadis.com
Twitter: @AndyAHCP
31.08.201648 Event driven Microservices with VERT.X & Kubernetes

More Related Content

PPTX
Building microservices with vert.x 3.0
PDF
PDF
Development with Vert.x: an event-driven application framework for the JVM
PDF
Vert.x introduction
PPTX
Reactive applications and microservices with Vert.x tool-kit
PDF
Vert.x
PPTX
On Docker and its use for LHC at CERN
PDF
Cloud networking deep dive
Building microservices with vert.x 3.0
Development with Vert.x: an event-driven application framework for the JVM
Vert.x introduction
Reactive applications and microservices with Vert.x tool-kit
Vert.x
On Docker and its use for LHC at CERN
Cloud networking deep dive

What's hot (20)

PPTX
Introduction to Kubernetes
PPTX
Vert.x vs akka
PPT
Kubernetes on CloudStack with coreOS
PDF
Building Reactive Microservices with Vert.x
PPTX
Kubernetes Introduction
PPTX
PPTX
autodiscoverable microservices with vertx3
PDF
Kubernetes in 15 minutes
PPTX
CloudStack Conference Public Clouds Use Cases
PPTX
Orchestrating Docker Containers with Google Kubernetes on OpenStack
PDF
Kubernetes Introduction
PPTX
DevOps with Kubernetes
PDF
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
PDF
Docker Madison, Introduction to Kubernetes
PDF
Kubernetes: My BFF
PDF
K8s storage-glusterfs-20180210
PDF
Scale Kubernetes to support 50000 services
PDF
Evolution of containers to kubernetes
PDF
Kubernetes on aws
PPTX
Kubernetes 101 Workshop
Introduction to Kubernetes
Vert.x vs akka
Kubernetes on CloudStack with coreOS
Building Reactive Microservices with Vert.x
Kubernetes Introduction
autodiscoverable microservices with vertx3
Kubernetes in 15 minutes
CloudStack Conference Public Clouds Use Cases
Orchestrating Docker Containers with Google Kubernetes on OpenStack
Kubernetes Introduction
DevOps with Kubernetes
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Docker Madison, Introduction to Kubernetes
Kubernetes: My BFF
K8s storage-glusterfs-20180210
Scale Kubernetes to support 50000 services
Evolution of containers to kubernetes
Kubernetes on aws
Kubernetes 101 Workshop
Ad

Viewers also liked (19)

PDF
A tale of queues — from ActiveMQ over Hazelcast to Disque - Philipp Krenn
PPTX
Building non-blocking JavaFX 8 applications with JacpFX [CON1823]
PDF
Vert.x - 2014 JDay Lviv (English)
PDF
Lean reactive services with vertx
PPTX
Vertx in production
PPT
JUDCon Brazil 2013 - Vert.x an introduction
PDF
How to Use HazelcastMQ for Flexible Messaging and More
PPTX
Reactive Systems And Vertx
PDF
Map Reduce in Hazelcast - Hazelcast User Group London Version
PPTX
Real World Enterprise Reactive Programming using Vert.x
PDF
Vert.X like Node.js but polyglot and reactive on JVM
PPTX
Vert.x for Microservices Architecture
PDF
Reactive Distributed Applications with Vert.x
PDF
Flink in Zalando's World of Microservices
PDF
ING microServices
PPTX
vert.x - asynchronous event-driven web applications on the JVM
PDF
REST vs. Messaging For Microservices
PDF
vert.x 3.1 - be reactive on the JVM but not only in Java
PPTX
OpenShift Enterprise 3.1 vs kubernetes
A tale of queues — from ActiveMQ over Hazelcast to Disque - Philipp Krenn
Building non-blocking JavaFX 8 applications with JacpFX [CON1823]
Vert.x - 2014 JDay Lviv (English)
Lean reactive services with vertx
Vertx in production
JUDCon Brazil 2013 - Vert.x an introduction
How to Use HazelcastMQ for Flexible Messaging and More
Reactive Systems And Vertx
Map Reduce in Hazelcast - Hazelcast User Group London Version
Real World Enterprise Reactive Programming using Vert.x
Vert.X like Node.js but polyglot and reactive on JVM
Vert.x for Microservices Architecture
Reactive Distributed Applications with Vert.x
Flink in Zalando's World of Microservices
ING microServices
vert.x - asynchronous event-driven web applications on the JVM
REST vs. Messaging For Microservices
vert.x 3.1 - be reactive on the JVM but not only in Java
OpenShift Enterprise 3.1 vs kubernetes
Ad

Similar to Event driven microservices with vertx and kubernetes (20)

PPTX
Event driven microservices with vxms, hazelcast and kubernetes - muenchen
PPTX
Vert.x based microservices with vxms
PDF
Kubernetes Architecture - beyond a black box - Part 1
PPTX
PPTX
PDF
From CoreOS to Kubernetes and Concourse CI
PPTX
Ultimate Guide to Microservice Architecture on Kubernetes
PDF
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
PDF
Reference architectures shows a microservices deployed to Kubernetes
PPTX
Kubernetes #1 intro
PDF
Building Bizweb Microservices with Docker
PDF
Building a High-Performance Reactive Microservices Architecture
PPSX
Service Mesh - Observability
PPTX
Kubernetes And Istio and Azure AKS DevOps
PPTX
Kubernetes Intro @HaufeDev
PDF
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
PDF
The App Developer's Kubernetes Toolbox
PDF
Reactive Polyglot Microservices with OpenShift and Vert.x
PDF
AKS: k8s e azure
PDF
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Event driven microservices with vxms, hazelcast and kubernetes - muenchen
Vert.x based microservices with vxms
Kubernetes Architecture - beyond a black box - Part 1
From CoreOS to Kubernetes and Concourse CI
Ultimate Guide to Microservice Architecture on Kubernetes
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
Reference architectures shows a microservices deployed to Kubernetes
Kubernetes #1 intro
Building Bizweb Microservices with Docker
Building a High-Performance Reactive Microservices Architecture
Service Mesh - Observability
Kubernetes And Istio and Azure AKS DevOps
Kubernetes Intro @HaufeDev
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
The App Developer's Kubernetes Toolbox
Reactive Polyglot Microservices with OpenShift and Vert.x
AKS: k8s e azure
Vert.X: Microservices Were Never So Easy (Clement Escoffier)

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PPTX
assetexplorer- product-overview - presentation
PDF
Cost to Outsource Software Development in 2025
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
medical staffing services at VALiNTRY
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Digital Strategies for Manufacturing Companies
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
top salesforce developer skills in 2025.pdf
assetexplorer- product-overview - presentation
Cost to Outsource Software Development in 2025
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Reimagine Home Health with the Power of Agentic AI​
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
medical staffing services at VALiNTRY
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Designing Intelligence for the Shop Floor.pdf
Odoo POS Development Services by CandidRoot Solutions
Digital Strategies for Manufacturing Companies
Operating system designcfffgfgggggggvggggggggg
Computer Software and OS of computer science of grade 11.pptx
CHAPTER 2 - PM Management and IT Context

Event driven microservices with vertx and kubernetes

  • 1. BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH Event driven Microservices with VERT.X & KubernetesAndy Moncsek Senior Consultant [email protected] Twitter: @AndyAHCP
  • 2. Agenda 2 31.08.2016 1. Why? 2. Event driven Microservices 3. VERT.X & Hazelcast 4. Docker & Kubernetes 5. Hazelcast & Kubernetes 6. Demo Event driven Microservices with VERT.X & Kubernetes
  • 3. 3 31.08.2016 Why? Event driven Microservices with VERT.X & Kubernetes
  • 4. Why?  Developing one Microservice is fun  Reduced scope  Choose your technology/language  Easy to deploy/test 4 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 5. Why? 5 31.08.2016 Event driven Microservices with VERT.X & Kubernetes Typical microservice architecture
  • 6. Why?  Developing many Microservices can be a pain  Complex deployment / orchestration / testing  Service registry & lookup  latency  DNS & Load balancer  complex 6 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 7. Why?  Idea  Avoid Service registry & lookup  Decouple services  async + events  Fast re-/deploy  And more: resilient,… 7 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 8. 8 31.08.2016 Event driven Microservices Event driven Microservices with VERT.X & Kubernetes
  • 9. Event driven microservice  Asynchronously  Any number of receivers  Easy Load Balancing  Pub/Sub + p2p  No need for service discovery 9 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 10. Event-driven (micro-)service 10 31.08.2016 Event driven Microservices with VERT.X & Kubernetes  Traditional way  Message Broker  No direct request / response  Broker  single point of failure
  • 11. Event-driven microservice 11 31.08.2016 Event driven Microservices with VERT.X & Kubernetes  Using an in-memory data grid  Automatic node lookup (services)  Failover  Shared data  replicated in cluster  Pub / sub  Request / response  NO Service discovery
  • 12. 12 31.08.2016 VERT.X & Hazelcast Event driven Microservices with VERT.X & Kubernetes
  • 13. What Vert.x is is a tool-kit for building reactive appications on the JVM 13 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 14. What Vert.x is 14 31.08.2016 scale polyglot general purposefun Event driven Microservices with VERT.X & Kubernetes
  • 15. Verticles Smallest deployable unit Scalable Actor-like Access to Vertx instance 15 31.08.2016 public class Service extends AbstractVerticle { public void start() { this.vertx... } public void stop() { } } Event driven Microservices with VERT.X & Kubernetes
  • 16. Event Loop Multi-Reactor - event loop (N threads for N verticles on one instance) Don’t block the Event-Loop! Don’t call us, we call you 16 31.08.2016 server.requestHandler(request -> { request.response().end(„Hello!"); }); Event driven Microservices with VERT.X & Kubernetes
  • 17. Event Bus (EB) Nervous system of Vert.x Communicate Distributed p2p Pub/sub Request-response 17 31.08.2016 EventBus eb = vertx.eventBus(); eb.send(“the.addr", “hello", ar -> { log.info(ar.result().body()); }); eb.consumer(“the.addr", message -> { message.reply(“don‘t know"); }); Event driven Microservices with VERT.X & Kubernetes
  • 18. What is Hazelcast ? is an In-Memory Data Grid (and the default cluster provider of Vert.X) 18 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 19. Hazelcast Open Source & Enterprise Edition Features: Distributed Caching & Compute Clustering Storage Management & Security 19 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 20. Hazelcast Clustering Discover Cluster Members using: Multicast TCP EC2 Cloud jclouds 20 31.08.2016 Plugins: AWS Azure Kubernetes Etcd … Event driven Microservices with VERT.X & Kubernetes
  • 21. Run Vert.x inclustered mode Vert.x default config: multicast „java –jar service.jar –cluster“ 21 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 22. Demo 22 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 24. 24 31.08.2016 Docker & Kubernetes Event driven Microservices with VERT.X & Kubernetes
  • 25. Docker isolation + automation + inherence + repository + versioning 25 31.08.2016 Ubuntu image Java image WildFly image App image Docker alone doesn‘t make you happy ;-) Event driven Microservices with VERT.X & Kubernetes
  • 26. Kubernetes Scale HA distributed containers Google starts >20billion apps/week Gmail, Web Search, Maps… 26 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 27. Kubernetes But It is not trivial 27 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 28. Kubernetes Service oriented Services -> machines “Let users manage applications, not machines” 28 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 29. Kubernetes Platform for hosting containers in clusteres Docker containers across multiple hosts Provides: monitoring, grouping, load balancing, auto-healing, scaling Contributors: Google, Redhat, Microsoft, ... 29 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 30. Kubernetes – Key concepts 30 31.08.2016 1. Push Docker image to Registry 2. Create service 3. Create Controller 4. (Scale Pods) Event driven Microservices with VERT.X & Kubernetes
  • 31. Kubernetes Pods Group of containers Same network / namespace / IP Environmental variables Shared volumes 31 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 32. Kubernetes Controller Ensure X pods are running Pod templates Rolling update 32 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 33. Kubernetes Services Pod discovery IP per service Route to pods selected with labels Load balancer 33 31.08.2016 Event driven Microservices with VERT.X & Kubernetes selector: name: frontend labels: name: frontend labels: name: frontend labels: name: frontend ports: -port: 80 targetPort: 8181 IP: 10.3.245.51 IP: 146.148.15.33 (pub.)
  • 34. Kubernetes – all together 34 31.08.2016 Event driven Microservices with VERT.X & Kubernetes https://github.com/brendandburns/gcp-live-k8s- visualizer
  • 35. 35 31.08.2016 Hazelcast & Kubernetes Event driven Microservices with VERT.X & Kubernetes
  • 36. Hazelcast & Kubernetes  What we want Case 1: Lookup all nodes (Verticles) managed by controller  1 – N pods  1 – X container Case 2: Lookup all nodes in a cluster  N services per cluster Routing to X pods 36 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 37. Hazelcast & Kubernetes  What we get 37 31.08.2016 Event driven Microservices with VERT.X & Kubernetes >kubectl scale rc frontend --replicas=5 >kubectl scale rc read --replicas=10 >kubectl scale rc write --replicas=2
  • 38. Hazelcast & Kubernetes  What we get Easy scale- up/down of service instances Failover provided by Kubernetes and Hazelcast Distributed Event-Bus  each Verticle instance Replicated shared data 38 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 39. Hazelcast node discovery in Kubernetes 39 31.08.2016 Event driven Microservices with VERT.X & Kubernetes Discover Cluster Members using: Multicast TCP EC2 Cloud jclouds Plugins: AWS Azure Kubernetes Etcd …
  • 40. Hazelcast node discovery in Kubernetes 40 31.08.2016 Event driven Microservices with VERT.X & Kubernetes Hazelcast discovery plugin for Kubernetes Option 1: Kubernetes REST API Allows discovery by service name Option 2: DNS Lookup Enable custom cluster.xml in Vert.X  put to classpath https://github.com/noctarius/hazelcast-kubernetes-discovery
  • 41. Hazelcast node discovery in Kubernetes (2) 41 31.08.2016 Event driven Microservices with VERT.X & Kubernetes  Vertx-service-discovery project (similar to Hazelcast Option 1) Option: Kubernetes REST API Allows discovery by label OR by namespace Enable custom cluster.xml in Vert.X  put to classpath https://github.com/vert-x3/vertx-service-discovery
  • 42. Hazelcast node discovery in Kubernetes 42 31.08.2016 Event driven Microservices with VERT.X & Kubernetes REST API<hazelcast> <properties> <!-- at the moment the discovery needs to be activated explicitly --> <property name="hazelcast.rest.enabled">true</property> </properties> … <discovery-strategy enabled="true" class=”….HazelcastKubernetesDiscoveryStrategy"> <properties> <property name="service-name">frontend-verticle</property> <property name="namespace">default</property> </properties> </discovery-strategy> </hazelcast> Missing in official Doc. ! • your Service name • master Service! • needs a Kubernetes Service! Hazelcast.xml / Cluster.xml
  • 43. Vert.x / Hazelcast node discovery in Kubernetes 43 31.08.2016 Event driven Microservices with VERT.X & Kubernetes REST API<hazelcast> <properties> <!-- at the moment the discovery needs to be activated explicitly --> <property name="hazelcast.rest.enabled">true</property> </properties> … <discovery-strategy enabled="true" class=”….HazelcastKubernetesDiscoveryStrategy"> <properties> <property name="service-label-name">cluster1</property> <property name="service-label-value">true</property> <property name="namespace">default</property> </properties> </discovery-strategy> </hazelcast> Missing in official Doc. ! • Partition your cluster with labels • OR find all in namespace Hazelcast.xml / Cluster.xml
  • 44. Hazelcast node discovery in Kubernetes 44 31.08.2016 Event driven Microservices with VERT.X & Kubernetes DNS Lookup DNS must be enabled in Kubernetes (kube2sky)! <hazelcast> <properties> <!-- at the moment the discovery needs to be activated explicitly --> <property name="hazelcast.discovery.enabled">true</property> </properties> … <discovery-strategy enabled="true" class=”….HazelcastKubernetesDiscoveryStrategy"> <properties> <property name="service-dns">cluster.local</property> </properties> </discovery-strategy> </hazelcast> Hazelcast.xml / Cluster.xml your Service name OR DNS_DOMAIN name (cluster.local  find all containers)
  • 45. 45 31.08.2016 Demo Event driven Microservices with VERT.X & Kubernetes https://github.com/amoAHCP/kube_vertx_demo/tree/dns-resolving
  • 46. Try this at home 46 31.08.2016 Event driven Microservices with VERT.X & Kubernetes Test Kubernetes in Docker https://github.com/vyshane/kid Many other Docker-compose based solutions available Limitations: no public IP & access to public service Workaround:  kubectl get -o yaml service/myService | grep nodePort  wget http://$(docker-machine ip):nodePort
  • 47. Conclusion Vert.x is lightweight, fast and easy to use typical web-app, microservices, aggregator / bridge, security, integration, stream-/event-processing  Kubernetes : Functional improvement over clustered infrastructure  easy deploy, update and scale of applications 47 31.08.2016 Event driven Microservices with VERT.X & Kubernetes
  • 48. Thank you Andy Moncsek Senior Consultant [email protected] Twitter: @AndyAHCP 31.08.201648 Event driven Microservices with VERT.X & Kubernetes