SlideShare uma empresa Scribd logo
1 de 38
Copyright © PLUMgrid, Inc. 2011-2016
what, why and how?
Service Discovery and Registration in a
Microservices Architecture
Copyright © PLUMgrid, Inc. 2011-2016
About us
2
PLUMgrid
Khaliq
Fawad
@fawadkhaliq
Mesosphere
Sanchez
Fernando
@fernandosanchez
Copyright © PLUMgrid, Inc. 2011-2016
• What is Service Discovery and Registration?
• A bit of history: the world in year 2000 (load balancers, physical servers and
CCIEs)
• Evolution: Virtualization brings shuffling and unpredictability
• Today: Containers demand automation
• What are Microservices and how do they affect Service Registration / Discovery?
• Service Registration/Service Discovery Patterns and Tools
• Patterns
• Tools: ZooKeeper, etcd, Consul, Mesos-DNS, Minuteman etc.
• Scope inside OpenStack?
• The need for SR/SG in Openstack (as in any stack)
• Current picture
• Desired future state
• Q/A
Agenda
Part 1 - A bit of history
- DISCLAIMER
- Trying to provide context about the “what” and the “why”.
- Historically inaccurate
- Obviously and shamelessly biased
- A bit blurry…
- DISCLAIMER (2)
- This goes WAY BACK to provide context. I felt a bit OLD
making this presentation
- If you know what a v92 modem is, you probably will also feel
old listening to it.
A bit of history (1) : Service Registration in the early days
(Very) early days: applications living
on a single physical server
“Service Discovery”? = How do I find
my service “by name” when it really is
an IP address? Well… DNS!
1:1 relationship between the
Application and the backend
implementing it
A bit of history (2) : Service Registration in the early days
Early days: applications living on MANY physical servers
1:N relationship between Service IPs and backend Servers
Physical App Server “churn” was still “manageable”
“Service Discovery”?: DNS + Virtual IPs + Virtual Hosts
Need a Load Balancer!
“Service Registration” = When I add a new server to my service, how does it
get added to the list of available ”Service Backends”?
** Add a new backend to the Service IP/ Virtual IP in the load balancer
(“Service Access Point”)
** Many times, added manually by a guy who has a vendor certification.
** Including “healthchecks” for each backend
A bit of history (3) : Service Registration in the early days
- Advent of the 3-tier architecture (web, application, dB)
- Need load balancing in each layer so
that each can scale up/down
- With their respective healthchecks
- So each layer now has a “Service Registration
/ Service Discovery” need!
A bit of history (4) : Virtualization FTW
- Enter server virtualization: Web/App/dB Servers can be
created and destroyed in minutes.
- “Automated” Service Registration becomes an evident need
and options start to appear (we’ll discuss each in the 2nd part):
- “Sidecar process” in workloads to register into centralized “backend
database”?
- “External Orchestrator” registers backends upon creation?
- “API Gateways” with client or server-side discovery?
- Applications can scale up and down more dynamically, even
automatically depending on load
Enter Containerization!
Private Copy
Shared
App 3
Libraries
Guest
Operating
System
Infrastructure
App 1
Libs
Host Operating System
Start / stop time One minute to few seconds Milliseconds
Workload density 10 - 100x1x
App 2
Libraries
Guest
Operating
System
App 1
Libraries
Guest
Operating
System
App 2
Libs
App 3
Libs
Virtual Machines Containers
Host Operating System
Hypervisor
Infrastructure
App 4
Libs
App 5
Libs
Today: Containers and Container Orchestration
- Containers multiply the potential complexity:
can be created/destroyed in milliseconds, with
endpoints being one or more orders of
magnitude more numerous than VMs
- Impossible to have manual procedures: need
automatic discovery of backends
- All options mentioned for VMs may still be
considered, with their pros and cons:
- Sidecar, Centralized Orchestration, Client/Server
discovery…
From Containers to Microservices: What and Why?
“The Monolith” and its issues
- Traditional applications were typically developed
as a single unified codebase
- Which tends to grow along time
- Making it harder to maintain, troubleshoot, evolve
Microservices: divide and conquer!
- Divide applications into independent pieces
(typically functional areas)
- Interconnect the pieces with networking and
(REST) APIs
Microservices: Divide and Conquer
Traditional Architecture
Many functions
in a single process
Siloed
teams
RESTAPIs
Microservices Architecture
Cross-functional
teams organized
around capabilities
Scales
individually
Each element of
functionality defined as
“microservices”
Scales
monolithically
Microservices Challenge: SD/SR on steroids!
RESTAPIs
Dependencies Between Microservices Running Multiple Microservices-based Apps
SD/SR Evolution: from tiered architecture to usvcs
14
Before Micro-Services
10’s of services with well-defined endpoints
100’s of backends implementing them, with long duration
Secure Infrastructure with DMZ and Firewalling.
After Micro-Services
1000’s of services requiring new VIPs to talk to others
100000’s of backends that are created and destroyed
constantly, sometimes in milliseconds
1000’s of services requiring Auth handshakes
W W W
A AA
Copyright © PLUMgrid, Inc. 2011-2016
Service Registration/Service
Patterns and Tools
Copyright © PLUMgrid, Inc. 2011-2016
Copyright © PLUMgrid, Inc. 2011-2016
Let’s talk about some terminologies that will help us better classify the tools
● Self registration
● Third-party registration
● Client-side discovery
● Service-side discovery
Service Registration/Service Discovery Patterns
Copyright © PLUMgrid, Inc. 2011-2016
Self registration
Self Registration
Microservice
Microservice
Service
Registry
When going
up/down
When going
up/down
Copyright © PLUMgrid, Inc. 2011-2016
Third-party registration
Third Party Registration
Microservice
Microservice
Service
Registry
starts service
detects service crash
Microservice Service Manager
stop service
Copyright © PLUMgrid, Inc. 2011-2016
Client-side discovery
Client-side Discovery
Client
Service
Registry
MicroserviceAPI Gateway
1
2
3
4
Copyright © PLUMgrid, Inc. 2011-2016
Server-side discovery
Server-side Discovery
Client
Service
Registry
Microservice
API Gateway1
2
3
4
Copyright © PLUMgrid, Inc. 2011-2016
Service Discovery Tools
Copyright © PLUMgrid, Inc. 2011-2016
Key-value store based on ephemeral nodes
Consensus using ZAB
Clients handle failure or load balancing themselves
HA: Non-quorum nodes return error on read/write
Allows watch on changes
Written in Java. Provide Java and C language bindings.
Heavyweight for simple architectures
Zookeeper /A/C1
/C2
/C3
/C4
/B/C5
/C6
/C7
/C/C8
ZK
Cluster
Container Host A
config
C1 C3 R/W
C2 C4 NGINX
Container Host B
C6
C7 R/WC5
NGINX
Container Host C
R/WC1
NGINX
Register C1
Watch Lookup C1
Copyright © PLUMgrid, Inc. 2011-2016
Distributed K/V store based on directories
Consensus using RAFT
Service definition queried using JSON-based HTTP APIs
Supports TTLs on keys
Clients handle failure or load balancing themselves
Allows watch on changes
Supports TLS/SSL
etcd
Key , Value
---------------------
C1 , 1.2.3.4:80
C2 , 1.2.3.4:88
C3 , 1.2.3.5:80
C4 , 1.2.3.5:88
C5 , 1.2.3.6:80
C6 , 1.2.3.6:88
etcd
Cluster
Register C1
Look up C1
Container Host A
config
C1 confd
C2 NGINX
1.2.3.4
Container Host B
C4
confdC3
NGINX
config
1.2.3.5
Container Host C
confdC5
NGINXC6
config
1.2.3.6
Watch
Copyright © PLUMgrid, Inc. 2011-2016
Distributed key, value(KV) store based on data directories
Provides comprehensive service health checking using both
in-built solutions as well as user provided custom solutions.
Provides REST based HTTP API for interaction.
Security: TLS and ACLs
Service database can be queried using DNS.
Does dynamic load balancing.
Supports single data center and can be scaled to support
multiple data centers.
consul
Monitoring Service Locks
Key-value Configuration Store
Host Clustering & Failure Detection
Copyright © PLUMgrid, Inc. 2011-2016
Distributed service for announcement
and discovery of services built on top of
etcd
Translates etcd keys and values to the
DNS
Sky DNS
dockerdocker-skydns-adaptor
etcd
skydns
microservice 1
microservice 2
microservice 3
Update DNS entries
Read configuration
HTTP
Client
Read
configuration 1 2 Call
microservice
Copyright © PLUMgrid, Inc. 2011-2016
Translates names to the IP address and port on the machine
currently running each application
Syncs with Mesos Master periodically
Updates the DNS records to reflect the latest state
Is stateless
Supports SRV records
Round robin for tasks with the same name
Central DNS
Mesos-DNS
Mesos-DNS
Record
Generator
Mesos
Master Cluster
State
DNS
Resolver
External DNS
Servers
Mesos
Slave
DNS
Lookup
DNS
Records
DNS
Lookup
DNS
Records
Copyright © PLUMgrid, Inc. 2011-2016
Works with DC/OS
Distributed DNS proxy in all members of the cluster
Dual-dispatching of DNS queries to multiple DC/OS
masters to avoid SPOF!
Able to optimally route queries to nodes in a cluster
Spartan
DC/OS Master
DC/OS Svc. Registry (DNS)
DC/OS Master
DC/OS Svc. Registry (DNS)
DC/OS Master
DC/OS Svc. Registry (DNS)
Corporate/External
DNS Server
DC/OS Agent
Container
Container
Container
DC/OS Agent
Container
Container
Container
DC/OS Agent
Container
Container
Container
DC/OS Agent
Container
Container
Container
Service 1
Service 2
Service 3
External Service
Copyright © PLUMgrid, Inc. 2011-2016
HAproxy based
Ingests state of running Marathon applications
Regenerates HAproxy config
Central LB for east-west
Potentially hundreds of Microservices are talking to each
other
If all that traffic goes through a centralized Load Balancer,
it quickly becomes a bottleneck
Marathon-lb
DMZ
marathon-lb
(HA Proxy)
marathon-lb
(HA Proxy)
marathon-lb
(HA Proxy)
Internet
Autoscale
Controller
App
App
App
App
Marathon
Mesos Agents (worker nodes)
Copyright © PLUMgrid, Inc. 2011-2016
Works with DC/OS
Distributed Load Balancer
Distributed database of VIPs and endpoints
Provides health-checking and endpoint availability
update
Minuteman
DC/OS Master
DC/OS Svc. Registry (DNS)
DC/OS Master
DC/OS Svc. Registry (DNS)
DC/OS Master
DC/OS Svc. Registry (DNS)
Corporate/External
DNS Server
DC/OS Agent
Container
Container
Container
DC/OS Agent
Container
Container
Container
DC/OS Agent
Container
Container
Container
DC/OS Agent
Container
Container
Container
Service 1
Service 2
Service 3
External Service
Copyright © PLUMgrid, Inc. 2011-2016
HAproxy on each client host
Uses Zookeper as Service Directory
Synapse: updates HAproxy
Nerve: provides backend registry to
Zookeeper
SmartStack
Provider
Application
Zookeeper
Publication
Consumer
Application
HA
Proxy
SynapseNerve
API
Discovery
Copyright © PLUMgrid, Inc. 2011-2016
Service Registration/Service
In OpenStack
Copyright © PLUMgrid, Inc. 2011-2016
● Container first class citizens in OpenStack
● Microservices use-cases are emerging
● Use of service discovery and service registration tools is unavoidable
● OpenStack as an infrastructure layer as well as platform layer, service
discovery and service registration is a need.
Need for Service Discovery/Registration in OpenStack?
Copyright © PLUMgrid, Inc. 2011-2016
Magnum: containers infrastructure management service
Kolla: containerized deployment of OpenStack
Murano: application catalog for OpenStack
Kuryr: brings OpenStack Networking (Neutron) and Storage to containers
Microservices architecture facilitators in OpenStack
Copyright © PLUMgrid, Inc. 2011-2016
Approach-1:
Containers and ecosystem entirely managed by container technologies like
Docker, Kubernetes, Mesos running atop OpenStack infrastructure
Approach-2:
Containers and ecosystem is partly managed by container technologies and
partly/completely managed/supported by OpenStack components: Neutron,
Nova, Keystone etc.
Two approaches in OpenStack
Copyright © PLUMgrid, Inc. 2011-2016
Approach-1 (Docker, Mesos, Kubernetes managed containers)
● Service discovery and service registration provided by the container
orchestration platform via the options discussed above: etcd, mesos-
dns, skydns etc
● OpenStack does not participate in service registration and discovery
Approach-2 (Hybrid scenarios with OpenStack tools are used)
● No off-the-shelf proper solution exists today
● Although we have all the tooling to achieve the results.
● Afterall, it boils down to “register”, “lookup” and load balancing
Current Picture
Copyright © PLUMgrid, Inc. 2011-2016
1. Load Balancer: Octavia
2. Designate: DNS
3. Kuryr+Neutron: Networking
4. Service Discovery: A new OpenStack project?
One of the possible options is #4, which makes use of existing OpenStack
tooling to provide service registration and discovery for services and
microservices inside OpenStack.
Future/Desired Future State
Copyright © PLUMgrid, Inc. 2011-2016
Questions?
Thank you!

Mais conteúdo relacionado

Mais procurados

Architecture of message oriented middleware
Architecture of message oriented middlewareArchitecture of message oriented middleware
Architecture of message oriented middleware
Likan Patra
 

Mais procurados (20)

Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
 
Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice Architecture
 
Microservices
MicroservicesMicroservices
Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
AWS re:Invent 2016: From Monolithic to Microservices: Evolving Architecture P...
AWS re:Invent 2016: From Monolithic to Microservices: Evolving Architecture P...AWS re:Invent 2016: From Monolithic to Microservices: Evolving Architecture P...
AWS re:Invent 2016: From Monolithic to Microservices: Evolving Architecture P...
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Microservices in Practice
Microservices in PracticeMicroservices in Practice
Microservices in Practice
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
Introduction to IAC and Terraform
Introduction to IAC and Terraform Introduction to IAC and Terraform
Introduction to IAC and Terraform
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Communication in a Microservice Architecture
Communication in a Microservice ArchitectureCommunication in a Microservice Architecture
Communication in a Microservice Architecture
 
Cloud testing
Cloud testingCloud testing
Cloud testing
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...
 
Architecture of message oriented middleware
Architecture of message oriented middlewareArchitecture of message oriented middleware
Architecture of message oriented middleware
 
Deep dive into AWS fargate
Deep dive into AWS fargateDeep dive into AWS fargate
Deep dive into AWS fargate
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 

Semelhante a Service Discovery and Registration in a Microservices Architecture

Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
Docker, Inc.
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
aspyker
 
Sukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud ManagementSukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak
 

Semelhante a Service Discovery and Registration in a Microservices Architecture (20)

Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
 
Reduce Risk with End to End Monitoring of Middleware-based Applications
Reduce Risk with End to End Monitoring of Middleware-based ApplicationsReduce Risk with End to End Monitoring of Middleware-based Applications
Reduce Risk with End to End Monitoring of Middleware-based Applications
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Cloud Foundry - Second Generation Code (CCNG). Technical Overview
Cloud Foundry - Second Generation Code (CCNG). Technical Overview Cloud Foundry - Second Generation Code (CCNG). Technical Overview
Cloud Foundry - Second Generation Code (CCNG). Technical Overview
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern Launguage
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
 
Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
 
Sukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud ManagementSukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud Management
 
How leading financial services organisations are winning with tech
How leading financial services organisations are winning with techHow leading financial services organisations are winning with tech
How leading financial services organisations are winning with tech
 
Full lifecycle of a microservice
Full lifecycle of a microserviceFull lifecycle of a microservice
Full lifecycle of a microservice
 
Microservice 微服務
Microservice 微服務Microservice 微服務
Microservice 微服務
 
Migrate a on-prem platform to the public cloud with Java - SpringBoot and PCF
Migrate a on-prem platform to the public cloud with Java - SpringBoot and PCFMigrate a on-prem platform to the public cloud with Java - SpringBoot and PCF
Migrate a on-prem platform to the public cloud with Java - SpringBoot and PCF
 
Reference architectures shows a microservices deployed to Kubernetes
Reference architectures shows a microservices deployed to KubernetesReference architectures shows a microservices deployed to Kubernetes
Reference architectures shows a microservices deployed to Kubernetes
 
Asynchronous micro-services and the unified log
Asynchronous micro-services and the unified logAsynchronous micro-services and the unified log
Asynchronous micro-services and the unified log
 
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 PreviewCloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
 
Microservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsMicroservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applications
 
Microservices
MicroservicesMicroservices
Microservices
 

Mais de PLUMgrid

Mais de PLUMgrid (20)

SDN Scale-out Testing at OpenStack Innovation Center (OSIC)
SDN Scale-out Testing at OpenStack Innovation Center (OSIC)SDN Scale-out Testing at OpenStack Innovation Center (OSIC)
SDN Scale-out Testing at OpenStack Innovation Center (OSIC)
 
In-kernel Analytics and Tracing with eBPF for OpenStack Clouds
In-kernel Analytics and Tracing with eBPF for OpenStack CloudsIn-kernel Analytics and Tracing with eBPF for OpenStack Clouds
In-kernel Analytics and Tracing with eBPF for OpenStack Clouds
 
Monitoring Security Policies for Container and OpenStack Clouds
Monitoring Security Policies for Container and OpenStack CloudsMonitoring Security Policies for Container and OpenStack Clouds
Monitoring Security Policies for Container and OpenStack Clouds
 
Delivering Composable NFV Services for Business, Residential and Mobile Edge
Delivering Composable NFV Services for Business, Residential and Mobile EdgeDelivering Composable NFV Services for Business, Residential and Mobile Edge
Delivering Composable NFV Services for Business, Residential and Mobile Edge
 
Design and Deploy Secure Clouds for Financial Services Use Cases
Design and Deploy Secure Clouds for Financial Services Use CasesDesign and Deploy Secure Clouds for Financial Services Use Cases
Design and Deploy Secure Clouds for Financial Services Use Cases
 
How to Quickly Implement a Secure Cloud for Government and Military | Webinar
How to Quickly Implement a Secure Cloud for Government and Military | WebinarHow to Quickly Implement a Secure Cloud for Government and Military | Webinar
How to Quickly Implement a Secure Cloud for Government and Military | Webinar
 
OpenStack and Application Delivery: Joy and Pain of an Intricate Relationship
OpenStack and Application Delivery: Joy and Pain of an Intricate RelationshipOpenStack and Application Delivery: Joy and Pain of an Intricate Relationship
OpenStack and Application Delivery: Joy and Pain of an Intricate Relationship
 
You Can Build Your OpenStack and Consume it Too
You Can Build Your OpenStack and Consume it TooYou Can Build Your OpenStack and Consume it Too
You Can Build Your OpenStack and Consume it Too
 
You Can Build Your OpenStack and Consume it Too
You Can Build Your OpenStack and Consume it TooYou Can Build Your OpenStack and Consume it Too
You Can Build Your OpenStack and Consume it Too
 
See Your OpenStack Network Like Never Before with Real-time Visibility and Mo...
See Your OpenStack Network Like Never Before with Real-time Visibility and Mo...See Your OpenStack Network Like Never Before with Real-time Visibility and Mo...
See Your OpenStack Network Like Never Before with Real-time Visibility and Mo...
 
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron IntegrationNetworking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
 
Implementing vCPE with OpenStack and Software Defined Networks
Implementing vCPE with OpenStack and Software Defined NetworksImplementing vCPE with OpenStack and Software Defined Networks
Implementing vCPE with OpenStack and Software Defined Networks
 
Hands-on Lab: Test Drive Your OpenStack Network
Hands-on Lab: Test Drive Your OpenStack NetworkHands-on Lab: Test Drive Your OpenStack Network
Hands-on Lab: Test Drive Your OpenStack Network
 
Securing Micro Services in Cloud Foundry
Securing Micro Services in Cloud FoundrySecuring Micro Services in Cloud Foundry
Securing Micro Services in Cloud Foundry
 
Docker Networking in Swarm, Mesos and Kubernetes [Docker Meetup Santa Clara |...
Docker Networking in Swarm, Mesos and Kubernetes [Docker Meetup Santa Clara |...Docker Networking in Swarm, Mesos and Kubernetes [Docker Meetup Santa Clara |...
Docker Networking in Swarm, Mesos and Kubernetes [Docker Meetup Santa Clara |...
 
Unified Underlay and Overlay SDNs for OpenStack Clouds
Unified Underlay and Overlay SDNs for OpenStack CloudsUnified Underlay and Overlay SDNs for OpenStack Clouds
Unified Underlay and Overlay SDNs for OpenStack Clouds
 
Building a Scalable Federated Hybrid Cloud
Building a Scalable Federated Hybrid CloudBuilding a Scalable Federated Hybrid Cloud
Building a Scalable Federated Hybrid Cloud
 
Managing Multi-hypervisor OpenStack Cloud with Single Virtual Network
Managing Multi-hypervisor OpenStack Cloud with Single Virtual NetworkManaging Multi-hypervisor OpenStack Cloud with Single Virtual Network
Managing Multi-hypervisor OpenStack Cloud with Single Virtual Network
 
Revolutionizing IT and Telecom Industry with OpenStack, SDN and NFV
Revolutionizing IT and Telecom Industry with OpenStack, SDN and NFVRevolutionizing IT and Telecom Industry with OpenStack, SDN and NFV
Revolutionizing IT and Telecom Industry with OpenStack, SDN and NFV
 
See Your OpenStack Network Like Never Before
See Your OpenStack Network Like Never BeforeSee Your OpenStack Network Like Never Before
See Your OpenStack Network Like Never Before
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Service Discovery and Registration in a Microservices Architecture

  • 1. Copyright © PLUMgrid, Inc. 2011-2016 what, why and how? Service Discovery and Registration in a Microservices Architecture
  • 2. Copyright © PLUMgrid, Inc. 2011-2016 About us 2 PLUMgrid Khaliq Fawad @fawadkhaliq Mesosphere Sanchez Fernando @fernandosanchez
  • 3. Copyright © PLUMgrid, Inc. 2011-2016 • What is Service Discovery and Registration? • A bit of history: the world in year 2000 (load balancers, physical servers and CCIEs) • Evolution: Virtualization brings shuffling and unpredictability • Today: Containers demand automation • What are Microservices and how do they affect Service Registration / Discovery? • Service Registration/Service Discovery Patterns and Tools • Patterns • Tools: ZooKeeper, etcd, Consul, Mesos-DNS, Minuteman etc. • Scope inside OpenStack? • The need for SR/SG in Openstack (as in any stack) • Current picture • Desired future state • Q/A Agenda
  • 4. Part 1 - A bit of history - DISCLAIMER - Trying to provide context about the “what” and the “why”. - Historically inaccurate - Obviously and shamelessly biased - A bit blurry… - DISCLAIMER (2) - This goes WAY BACK to provide context. I felt a bit OLD making this presentation - If you know what a v92 modem is, you probably will also feel old listening to it.
  • 5. A bit of history (1) : Service Registration in the early days (Very) early days: applications living on a single physical server “Service Discovery”? = How do I find my service “by name” when it really is an IP address? Well… DNS! 1:1 relationship between the Application and the backend implementing it
  • 6. A bit of history (2) : Service Registration in the early days Early days: applications living on MANY physical servers 1:N relationship between Service IPs and backend Servers Physical App Server “churn” was still “manageable” “Service Discovery”?: DNS + Virtual IPs + Virtual Hosts Need a Load Balancer! “Service Registration” = When I add a new server to my service, how does it get added to the list of available ”Service Backends”? ** Add a new backend to the Service IP/ Virtual IP in the load balancer (“Service Access Point”) ** Many times, added manually by a guy who has a vendor certification. ** Including “healthchecks” for each backend
  • 7. A bit of history (3) : Service Registration in the early days - Advent of the 3-tier architecture (web, application, dB) - Need load balancing in each layer so that each can scale up/down - With their respective healthchecks - So each layer now has a “Service Registration / Service Discovery” need!
  • 8. A bit of history (4) : Virtualization FTW - Enter server virtualization: Web/App/dB Servers can be created and destroyed in minutes. - “Automated” Service Registration becomes an evident need and options start to appear (we’ll discuss each in the 2nd part): - “Sidecar process” in workloads to register into centralized “backend database”? - “External Orchestrator” registers backends upon creation? - “API Gateways” with client or server-side discovery? - Applications can scale up and down more dynamically, even automatically depending on load
  • 9. Enter Containerization! Private Copy Shared App 3 Libraries Guest Operating System Infrastructure App 1 Libs Host Operating System Start / stop time One minute to few seconds Milliseconds Workload density 10 - 100x1x App 2 Libraries Guest Operating System App 1 Libraries Guest Operating System App 2 Libs App 3 Libs Virtual Machines Containers Host Operating System Hypervisor Infrastructure App 4 Libs App 5 Libs
  • 10. Today: Containers and Container Orchestration - Containers multiply the potential complexity: can be created/destroyed in milliseconds, with endpoints being one or more orders of magnitude more numerous than VMs - Impossible to have manual procedures: need automatic discovery of backends - All options mentioned for VMs may still be considered, with their pros and cons: - Sidecar, Centralized Orchestration, Client/Server discovery…
  • 11. From Containers to Microservices: What and Why? “The Monolith” and its issues - Traditional applications were typically developed as a single unified codebase - Which tends to grow along time - Making it harder to maintain, troubleshoot, evolve Microservices: divide and conquer! - Divide applications into independent pieces (typically functional areas) - Interconnect the pieces with networking and (REST) APIs
  • 12. Microservices: Divide and Conquer Traditional Architecture Many functions in a single process Siloed teams RESTAPIs Microservices Architecture Cross-functional teams organized around capabilities Scales individually Each element of functionality defined as “microservices” Scales monolithically
  • 13. Microservices Challenge: SD/SR on steroids! RESTAPIs Dependencies Between Microservices Running Multiple Microservices-based Apps
  • 14. SD/SR Evolution: from tiered architecture to usvcs 14 Before Micro-Services 10’s of services with well-defined endpoints 100’s of backends implementing them, with long duration Secure Infrastructure with DMZ and Firewalling. After Micro-Services 1000’s of services requiring new VIPs to talk to others 100000’s of backends that are created and destroyed constantly, sometimes in milliseconds 1000’s of services requiring Auth handshakes W W W A AA
  • 15. Copyright © PLUMgrid, Inc. 2011-2016 Service Registration/Service Patterns and Tools
  • 16. Copyright © PLUMgrid, Inc. 2011-2016
  • 17. Copyright © PLUMgrid, Inc. 2011-2016 Let’s talk about some terminologies that will help us better classify the tools ● Self registration ● Third-party registration ● Client-side discovery ● Service-side discovery Service Registration/Service Discovery Patterns
  • 18. Copyright © PLUMgrid, Inc. 2011-2016 Self registration Self Registration Microservice Microservice Service Registry When going up/down When going up/down
  • 19. Copyright © PLUMgrid, Inc. 2011-2016 Third-party registration Third Party Registration Microservice Microservice Service Registry starts service detects service crash Microservice Service Manager stop service
  • 20. Copyright © PLUMgrid, Inc. 2011-2016 Client-side discovery Client-side Discovery Client Service Registry MicroserviceAPI Gateway 1 2 3 4
  • 21. Copyright © PLUMgrid, Inc. 2011-2016 Server-side discovery Server-side Discovery Client Service Registry Microservice API Gateway1 2 3 4
  • 22. Copyright © PLUMgrid, Inc. 2011-2016 Service Discovery Tools
  • 23. Copyright © PLUMgrid, Inc. 2011-2016 Key-value store based on ephemeral nodes Consensus using ZAB Clients handle failure or load balancing themselves HA: Non-quorum nodes return error on read/write Allows watch on changes Written in Java. Provide Java and C language bindings. Heavyweight for simple architectures Zookeeper /A/C1 /C2 /C3 /C4 /B/C5 /C6 /C7 /C/C8 ZK Cluster Container Host A config C1 C3 R/W C2 C4 NGINX Container Host B C6 C7 R/WC5 NGINX Container Host C R/WC1 NGINX Register C1 Watch Lookup C1
  • 24. Copyright © PLUMgrid, Inc. 2011-2016 Distributed K/V store based on directories Consensus using RAFT Service definition queried using JSON-based HTTP APIs Supports TTLs on keys Clients handle failure or load balancing themselves Allows watch on changes Supports TLS/SSL etcd Key , Value --------------------- C1 , 1.2.3.4:80 C2 , 1.2.3.4:88 C3 , 1.2.3.5:80 C4 , 1.2.3.5:88 C5 , 1.2.3.6:80 C6 , 1.2.3.6:88 etcd Cluster Register C1 Look up C1 Container Host A config C1 confd C2 NGINX 1.2.3.4 Container Host B C4 confdC3 NGINX config 1.2.3.5 Container Host C confdC5 NGINXC6 config 1.2.3.6 Watch
  • 25. Copyright © PLUMgrid, Inc. 2011-2016 Distributed key, value(KV) store based on data directories Provides comprehensive service health checking using both in-built solutions as well as user provided custom solutions. Provides REST based HTTP API for interaction. Security: TLS and ACLs Service database can be queried using DNS. Does dynamic load balancing. Supports single data center and can be scaled to support multiple data centers. consul Monitoring Service Locks Key-value Configuration Store Host Clustering & Failure Detection
  • 26. Copyright © PLUMgrid, Inc. 2011-2016 Distributed service for announcement and discovery of services built on top of etcd Translates etcd keys and values to the DNS Sky DNS dockerdocker-skydns-adaptor etcd skydns microservice 1 microservice 2 microservice 3 Update DNS entries Read configuration HTTP Client Read configuration 1 2 Call microservice
  • 27. Copyright © PLUMgrid, Inc. 2011-2016 Translates names to the IP address and port on the machine currently running each application Syncs with Mesos Master periodically Updates the DNS records to reflect the latest state Is stateless Supports SRV records Round robin for tasks with the same name Central DNS Mesos-DNS Mesos-DNS Record Generator Mesos Master Cluster State DNS Resolver External DNS Servers Mesos Slave DNS Lookup DNS Records DNS Lookup DNS Records
  • 28. Copyright © PLUMgrid, Inc. 2011-2016 Works with DC/OS Distributed DNS proxy in all members of the cluster Dual-dispatching of DNS queries to multiple DC/OS masters to avoid SPOF! Able to optimally route queries to nodes in a cluster Spartan DC/OS Master DC/OS Svc. Registry (DNS) DC/OS Master DC/OS Svc. Registry (DNS) DC/OS Master DC/OS Svc. Registry (DNS) Corporate/External DNS Server DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container Service 1 Service 2 Service 3 External Service
  • 29. Copyright © PLUMgrid, Inc. 2011-2016 HAproxy based Ingests state of running Marathon applications Regenerates HAproxy config Central LB for east-west Potentially hundreds of Microservices are talking to each other If all that traffic goes through a centralized Load Balancer, it quickly becomes a bottleneck Marathon-lb DMZ marathon-lb (HA Proxy) marathon-lb (HA Proxy) marathon-lb (HA Proxy) Internet Autoscale Controller App App App App Marathon Mesos Agents (worker nodes)
  • 30. Copyright © PLUMgrid, Inc. 2011-2016 Works with DC/OS Distributed Load Balancer Distributed database of VIPs and endpoints Provides health-checking and endpoint availability update Minuteman DC/OS Master DC/OS Svc. Registry (DNS) DC/OS Master DC/OS Svc. Registry (DNS) DC/OS Master DC/OS Svc. Registry (DNS) Corporate/External DNS Server DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container Service 1 Service 2 Service 3 External Service
  • 31. Copyright © PLUMgrid, Inc. 2011-2016 HAproxy on each client host Uses Zookeper as Service Directory Synapse: updates HAproxy Nerve: provides backend registry to Zookeeper SmartStack Provider Application Zookeeper Publication Consumer Application HA Proxy SynapseNerve API Discovery
  • 32. Copyright © PLUMgrid, Inc. 2011-2016 Service Registration/Service In OpenStack
  • 33. Copyright © PLUMgrid, Inc. 2011-2016 ● Container first class citizens in OpenStack ● Microservices use-cases are emerging ● Use of service discovery and service registration tools is unavoidable ● OpenStack as an infrastructure layer as well as platform layer, service discovery and service registration is a need. Need for Service Discovery/Registration in OpenStack?
  • 34. Copyright © PLUMgrid, Inc. 2011-2016 Magnum: containers infrastructure management service Kolla: containerized deployment of OpenStack Murano: application catalog for OpenStack Kuryr: brings OpenStack Networking (Neutron) and Storage to containers Microservices architecture facilitators in OpenStack
  • 35. Copyright © PLUMgrid, Inc. 2011-2016 Approach-1: Containers and ecosystem entirely managed by container technologies like Docker, Kubernetes, Mesos running atop OpenStack infrastructure Approach-2: Containers and ecosystem is partly managed by container technologies and partly/completely managed/supported by OpenStack components: Neutron, Nova, Keystone etc. Two approaches in OpenStack
  • 36. Copyright © PLUMgrid, Inc. 2011-2016 Approach-1 (Docker, Mesos, Kubernetes managed containers) ● Service discovery and service registration provided by the container orchestration platform via the options discussed above: etcd, mesos- dns, skydns etc ● OpenStack does not participate in service registration and discovery Approach-2 (Hybrid scenarios with OpenStack tools are used) ● No off-the-shelf proper solution exists today ● Although we have all the tooling to achieve the results. ● Afterall, it boils down to “register”, “lookup” and load balancing Current Picture
  • 37. Copyright © PLUMgrid, Inc. 2011-2016 1. Load Balancer: Octavia 2. Designate: DNS 3. Kuryr+Neutron: Networking 4. Service Discovery: A new OpenStack project? One of the possible options is #4, which makes use of existing OpenStack tooling to provide service registration and discovery for services and microservices inside OpenStack. Future/Desired Future State
  • 38. Copyright © PLUMgrid, Inc. 2011-2016 Questions? Thank you!