CONDUCT YOUR MICROSERVICES On the path to cloud-native applications Sylvain Hellegouarch @lawouach
CONDUCT YOUR MICROSERVICESOn the path to cloud-native applications
Sylvain Hellegouarch@lawouach
Before you had one big app
Sylvain Hellegouarch@lawouach
Now, you have a zillion of smaller services
Sylvain Hellegouarch@lawouach
Why so many of them?
The big app had hidden links and dependencies.
These Functions still exist but their relationships are now public.
➢Who becomes reponsible for those?
Sylvain Hellegouarch@lawouach
Be careful about projecting complexity
Sylvain Hellegouarch@lawouach
Going forward…
StandardizeAutomate
IsolateOrchestrate
MonitorAdapt
Sylvain Hellegouarch@lawouach
Helping the ops!
Sysadmins cannot be expected to support thousands of dynamic services the old fashion way
We need a tool to orchestrate all of those pieces together.
Sylvain Hellegouarch@lawouach
Orchestration
Microservices lifecycle and relationships conductor
Orchestration brings (some) order to the microservices chaos
➢ Docker Swarm➢ Apache Mesos/Marathon➢ Google Kubernetes➢ CoreOS Fleet➢ Cloud Foundry Diego
Sylvain Hellegouarch@lawouach
Mesos
Cluster resources sharing
Advertizes resources to high-level schedulers and executors
Isolates executed tasks into mesos or docker containers
Sylvain Hellegouarch@lawouach
Mesos (misc)
Master/slave architecture
Infrastructure neutral
Docker Swarm and Kubernetes can benefit from Mesos
MesosDNS for discovery (though you can use Consul, WeaveDNS too)
Proven: used in production at airbnb, Apple, netflix, Mesosphere…
Open Source (Apache 2.0 license)
Sylvain Hellegouarch@lawouach
Marathon: a Mesos framework
Schedules your microservices based on needed vs available resources (offered by Mesos)
Executes microservices and manages their lifecycle
Sylvain Hellegouarch@lawouach
High level HTTP REST API
Sylvain Hellegouarch@lawouach
Marathon: Specification
Sylvain Hellegouarch@lawouach
Marathon: Resources
How much do you need?
➢ Match Marathon’s agent role set at startup
Sylvain Hellegouarch@lawouach
How should it be deployed?
➢ Match Mesos slave attributes➢ UNIQUE, GROUP BY, CLUSTER,
LIKE, UNLIKE…
Marathon: Constraints
Sylvain Hellegouarch@lawouach
What is the upgrade/rollback strategy?
➢ Ensures service continuity
Marathon: Upgrade
Sylvain Hellegouarch@lawouach
Input for redundancy/failure scenarios
➢Ensures service availability
Marathon: Health-check
Sylvain Hellegouarch@lawouach
Relationships to other services
➢ Manages relationships
Marathon: Dependencies
Sylvain Hellegouarch@lawouach
Marathon: Application definition
Sylvain Hellegouarch@lawouach
Marathon: More…
Application groups supported
Deployment events feedack
Straight documentation
Sylvain Hellegouarch@lawouach
Marathon: ChallengesNo command line, less natural for scripting
Can Marathon cope with the speed of changes brought on Docker itself?
Not a simple debugging experience
AFAIK, docker containers are never removed automatically
Might be too generic for your use case
Sylvain Hellegouarch@lawouach
Marathon: Getting started?Design your system so that it copes with interruptions
Define your deployment workflows carefully: install, upgrade, rollback, failover...
Use a service discovery (weave, consul, etcd, MesosDNS)
Consider using an overlay network to decouple your network from the infrastructure (weave, VXLAN)
Sylvain Hellegouarch@lawouach
What’s next?
Explore but be patient!
Build familiarity to gain trust and confidence
Sylvain Hellegouarch@lawouach