Microservices Done Right: Key Ingredients for Microservices Success
2016-02 Zero to microservices Brandon - Meetupfiles.meetup.com/19519977/2016-02 Zero to... · New...
Transcript of 2016-02 Zero to microservices Brandon - Meetupfiles.meetup.com/19519977/2016-02 Zero to... · New...
Zero to Microservices in 5 minutes using Docker ContainersMathew Lodge (@mathewlodge)Weaveworks (@weaveworks)https://www.weave.works/
2
Going faster with software delivery is now a business issue
“Software is eating the world”• The old IT/software model is too slow• Customers expect pace of innovation of
Google, Facebook, Uber, Netflix, Amazon in all things
• Velocity comes from microservices approach & rest of market wants to do the same
Microservices/DevOps to go faster• Smaller teams combining dev & ops roles,
working on smaller services vs. single large code base
• Each microservice team picks its own tech and self-services
• Table stakes: open source, cloud, containers, continuous integration
Problem: Microservices also increase complexity
4Source: Adrian Colyer
New class of “microservices infrastructure” is emerging
• Create Microservices, Manage and Control them– Extreme simplicity and speed– Add value alongside any platform choice, or
standalone– Packaged and priced for bottoms-up team adoption
5
Visual-ization
APIRoutingSDN
Data persistConfig Provision
Microservices infrastructure
Containers
Programmable infra
Scheduling / Orchestration
A typical microservice scenario
6
Replica 1 Replica 2 Replica 3
Client Client Client
API proxy / load balancer
How this used to work in Docker
7
Docker host 1 Docker host 2
Client
808080
Worker
4438443
Docker Networking introduced in v1.9
8
Docker host 1 Docker host 2
Client
80
Worker
443
Ethernet bridge on Docker host VXLAN tunnel between hosts Ethernet bridge on Docker host
Microservice on Docker 1.9
9
Client A container
Client B container
Client C container
Worker X container
Worker Ycontainer
Worker Z container
HA Proxy / nginx
container
Consul 1VM
Consul 2VM
Consul 3VM
Cluster Store
Container SDN
Docker host
config
Docker host
config
Using Weave Net to make things simpler
10
Client A container
Client B container
Client C container
Worker X container
Worker Ycontainer
Worker Z container
Weave Net container
[“Micro DNS”]Container SDN
Consul 1VM
Consul 2VM
Consul 3VM
Cluster Store
Demo• Up and running in less than 5 minutes• Built-in service discovery
Linux HostHow it works• Weave router container runs on each
Docker host– Allocates IP addresses to containers– Maintains IP address to DNS name mapping– Responds to DNS lookups on container
names– “Gossips” updates to other routers, builds
eventually consistent cache
• Inter-host connectivity via VXLAN– All containers on local bridge– Local bridges connected via VXLAN
12
Server/VM/AWS/Azure/GCP
Docker
Weave Docker proxy
Weave router/DNS
Replica n
Client x
Other hosts
Plug-in architectures today
13
Docker
Docker Networking
Libnetwork API
3rd Party libnetworkPlugin
Kubernetes
CNI API
3rd Party CNIPlugin
Underlay Network Underlay Network
Simple deployment on AWS ECS
• Zero configuration beyond starting instances in auto-scale group:– Weave Net automatically finds other Weave routers via Autoscale Groups API
14
AWS Autoscaling Group
Weave ECS AMI
Weave ECS AMI
Weave ECS AMI
Weave ECS AMI
Traditional 3-tier architecture
Incoming traffic
Load balancers
Application servers
Database and replica
Microservice architecture
Public APIWeb UI
NoSQL serversDatabase
MessageBroker
Services
Monitoring microservices is different• Netflix USE*:
– Utilization– Saturation– Error rate
• Utilization metrics– (Success) response times– Queue depth
• Saturation metrics– CPU– Memory– IO bandwidth– Network bandwidth
• Error metrics– Non 2xx HTTP response rate– No response rate
* http://www.brendangregg.com/usemethod.html
Traditional monitoring systems focus on saturation only
Need topology information to use USE
Weave Scope• Microservice-centric monitoring
• Live topology
• No instrumentation, no configuration
• 100% interactive
But how do we get Utilization and Error rates?
Weave Flux demo
22
Thank you!http://www.weave.works/
Weave eventually consistent in-memory DB(AP from the CAP theorem)
24