Event driven Microservices with VERT.X & Kubernetes

Slides:



Advertisements
Similar presentations
Microsoft Ignite /16/2017 2:42 PM
Advertisements

Features Scalability Availability Latency Lifecycle Data Integrity Portability Manage Services Deliver Features Faster Create Business Value.
Cloud Computing for the Enterprise November 18th, This work is licensed under a Creative Commons.
Windows Azure Conference 2014 Deploy your Java workloads on Windows Azure.
Building micro-service based applications using Azure Service Fabric
Creating highly available and resilient Microservices on Microsoft Azure Service Fabric
Mick Badran Using Microsoft Service Fabric to build your next Solution with zero downtime – Lvl 300 CLD32 5.
Microsoft Azure and ServiceNow: Extending IT Best Practices to the Microsoft Cloud to Give Enterprises Total Control of Their Infrastructure MICROSOFT.
And scales by cloning the app on multiple servers/VMs/Containers Traditional architecture approach Microservices architecture approach A microservice.
#msitconf. Damien Caro Technical Evangelist Manager, Что будет, если приложение поместить в контейнер? What happens if the application.
Sam Vanhoutte CTO Codit, Integration MVP Azure Service Fabric: notes from the field.
Docker for Ops: Operationalize Your Apps in Production Vivek Saraswat Sr. Product Evan Hazlett Sr. Software
Microservice Bus Tutorial Huabing Zhao
Device Maintenance and Management, Parental Control, and Theft Protection for Home Users Made Easy with Remo MORE and Power of Azure MICROSOFT AZURE APP.
DevOps Cloud Native Microservices
Build /26/2018 6:17 AM Building Resilient, Scalable Services with Microsoft Azure Service Fabric Érsek © 2015 Microsoft Corporation.
DocFusion 365 Intelligent Template Designer and Document Generation Engine on Azure Enables Your Team to Increase Productivity MICROSOFT AZURE APP BUILDER.
Dockerize OpenEdge Srinivasa Rao Nalla.
OpenLegacy Training Day Four Introduction to Microservices
Docker and Azure Container Service
Google App Engine Mandeep Singh (37926)
Docker Birthday #3.
Open Source distributed document DB for an enterprise
In-Depth Introduction to Docker
Platform as a Service.
Cloud Computing Platform as a Service
Couchbase Server is a NoSQL Database with a SQL-Based Query Language
Introduction to Microservices Prepared for
Amit R Bhatia / Puneeth Nayak
In-Memory Performance
Eng Computation & Data Science.
Using External Persistent Volumes to Reduce Recovery Times and Achieve High Availability Dinesh Israni, Senior Software Engineer, Portworx Inc.
OpenNebula Offers an Enterprise-Ready, Fully Open Management Solution for Private and Public Clouds – Try It Easily with an Azure Marketplace Sandbox MICROSOFT.
9/20/ :55 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
2017 Real Questions
Kubernetes Container Orchestration
Replication Middleware for Cloud Based Storage Service
Microsoft Build /8/2018 5:15 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Using docker containers
Azure Container Instances
Oscar AP by Massive Analytic: A Precognitive Analytics Platform for Effortless Data-Driven Decisions. Now Available in Azure Marketplace MICROSOFT AZURE.
Designed for Big Data Visual Analytics, Zoomdata Allows Business Users to Quickly Connect, Stream, and Visualize Data in the Microsoft Azure Platform MICROSOFT.
Securing Cloud-Native Applications Jason Schmitt CEO
Kubernetes intro.
Scalable SoftNAS Cloud Protects Customers’ Mission-Critical Data in the Cloud with a Highly Available, Flexible Solution for Microsoft Azure MICROSOFT.
Logsign All-In-One Security Information and Event Management (SIEM) Solution Built on Azure Improves Security & Business Continuity MICROSOFT AZURE APP.
Intro to Docker Containers and Orchestration in the Cloud
20409A 7: Installing and Configuring System Center 2012 R2 Virtual Machine Manager Module 7 Installing and Configuring System Center 2012 R2 Virtual.
Developing for the cloud with Visual Studio
Getting Started with Kubernetes and Rancher 2.0
Clouds & Containers: Case Studies for Big Data
Intro about Contanier and Docker Technology
Keep Your Digital Media Assets Safe and Save Time by Choosing ImageVault to be Your Digital Asset Management Solution, Hosted in Microsoft Azure Partner.
Appcelerator Arrow: Build APIs in Minutes. Connect to Any Data Source
Learn. Imagine. Build. .NET Conf
AWS Cloud Computing Masaki.
Container cluster management solutions
autodiscoverable microservices with vertx3
DEVOPS & THE FUTURE OF TESTING
Agenda Need of Cloud Computing What is Cloud Computing
OpenShift as a cloud for Data Science
Kubernetes.
Container technology, Microservices, and DevOps
OpenStack Summit Berlin – November 14, 2018
Building highly scalable enterprise systems (on Azure)
Johan Lindberg, inRiver
Docker for DBAs SQL Saturday 8/17/2019.
Containers on Azure Peter Lasne Sr. Software Development Engineer
9/16/2019 6:55 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Presentation transcript:

Event driven Microservices with VERT.X & Kubernetes Andy Moncsek Senior Consultant Andy.Moncsek@trivadis.com Twitter: @AndyAHCP

Agenda Why? Event driven Microservices VERT.X & Hazelcast Docker & Kubernetes Hazelcast & Kubernetes Demo 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Why? 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Life could be so easy ;-) Why? Developing one Microservice is fun Reduced scope Choose your technology/language Easy to deploy/test Life could be so easy ;-) 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Why? Typical microservice architecture 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Why? Developing many Microservices can be a pain Complex deployment / orchestration / testing Service registry & lookup  latency DNS & Load balancer  complex 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Why? Idea Avoid Service registry & lookup Decouple services  async + events Fast re-/deploy And more: resilient,… 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Event driven Microservices 07.11.2018 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 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Event-driven (micro-)service Traditional way  Message Broker No direct request / response Broker  single point of failure 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Event-driven microservice Using an in-memory data grid Automatic node lookup (services) Failover Shared data  replicated in cluster Pub / sub Request / response NO Service discovery 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

VERT.X & Hazelcast 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

is a tool-kit for building reactive appications on the JVM What Vert.x is is a tool-kit for building reactive appications on the JVM 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

What Vert.x is scale polyglot fun general purpose Scale: Event driven 07.11.2018 Event driven Microservices with VERT.X & Kubernetes Scale: Event driven Non blocking Max concurrency on less kernel threads polyglot: Java JavaScript Groovy General purpose Network utilities Web applications High vol. event processing Plain message bus Fun Lightweight Fast Modular extensible

Verticles Smallest deployable unit Scalable Actor-like Access to Vertx instance public class Service extends AbstractVerticle { public void start() { this.vertx... } public void stop() { 07.11.2018 Event driven Microservices with VERT.X & Kubernetes This model is entirely optional and Vert.x does not force you to create your applications in this way if you don’t want to..

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 server.requestHandler(request -> { request.response().end(„Hello!"); }); 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Event Bus (EB) Nervous system of Vert.x Communicate Distributed p2p Pub/sub Request-response 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"); 07.11.2018 Event driven Microservices with VERT.X & Kubernetes 1 EB / Vert.x instance

(and the default cluster provider of Vert.X) What is Hazelcast ? is an In-Memory Data Grid (and the default cluster provider of Vert.X) 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast Open Source & Enterprise Edition Features: Distributed Caching & Compute Clustering Storage Management & Security 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast Clustering Discover Cluster Members using: Multicast TCP EC2 Cloud jclouds Plugins: AWS Azure Kubernetes Etcd … 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Run Vert.x inclustered mode Vert.x default config: multicast „java –jar service.jar –cluster“ 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Demo 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Demo https://github.com/amoAHCP/kube_vertx_demo 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Docker & Kubernetes 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Docker isolation + automation + inherence + repository + versioning Ubuntu image Java image WildFly image App image isolation + automation + inherence + repository + versioning Docker alone doesn‘t make you happy ;-) 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes Scale Google starts >20billion apps/week HA distributed containers Google starts >20billion apps/week Gmail, Web Search, Maps… 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes But It is not trivial 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes Service oriented Services -> machines “Let users manage applications, not machines” 07.11.2018 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, ... 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes – Key concepts Push Docker image to Registry Create service Create Controller (Scale Pods) 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes Pods Group of containers Same network / namespace / IP Environmental variables Shared volumes 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes Controller Ensure X pods are running Pod templates Rolling update 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes Services Pod discovery IP per service Route to pods selected with labels Load balancer ports: -port: 80 targetPort: 8181 IP: 10.3.245.51 IP: 146.148.15.33 (pub.) selector: name: frontend labels: 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Kubernetes – all together https://github.com/brendandburns/gcp-live-k8s-visualizer 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast & Kubernetes 07.11.2018 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 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast & Kubernetes  What we get >kubectl scale rc frontend --replicas=5 >kubectl scale rc read --replicas=10 >kubectl scale rc write --replicas=2 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

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 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast node discovery in Kubernetes Discover Cluster Members using: Multicast TCP EC2 Cloud jclouds Plugins: AWS Azure Kubernetes Etcd … 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast node discovery in 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 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast node discovery in Kubernetes (2) 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 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast node discovery in Kubernetes <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"> <property name="service-name">frontend-verticle</property> <property name="namespace">default</property> </discovery-strategy> </hazelcast> REST API Missing in official Doc. ! your Service name master Service! needs a Kubernetes Service! Hazelcast.xml / Cluster.xml 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Vert.x / Hazelcast node discovery in Kubernetes <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"> <property name="service-label-name">cluster1</property> <property name="service-label-value">true</property> <property name="namespace">default</property> </discovery-strategy> </hazelcast> REST API Missing in official Doc. ! Partition your cluster with labels OR find all in namespace Hazelcast.xml / Cluster.xml 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Hazelcast node discovery in 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"> <property name="service-dns">cluster.local</property> </discovery-strategy> </hazelcast> your Service name OR DNS_DOMAIN name (cluster.local  find all containers) Hazelcast.xml / Cluster.xml 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Demo https://github.com/amoAHCP/kube_vertx_demo/tree/dns-resolving 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

Try this at home 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 07.11.2018 Event driven Microservices with VERT.X & Kubernetes

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 07.11.2018 Event driven Microservices with VERT.X & Kubernetes Example Szenario: Legacy middleware with new AngularJS UI, Aggregator written in Vert.x can call legacy services , new Services can be written in Vert.x

Thank you Andy Moncsek Senior Consultant Andy.Moncsek@trivadis.com Twitter: @AndyAHCP 07.11.2018 Event driven Microservices with VERT.X & Kubernetes