Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microservices with Docker and Weave

Microservices with Docker and Weave


Johann Romefort

April 22, 2015


  1. Microservices with Docker and Weave Johann Romefort

  2. About me… • Startup guy, last past 7 years in

    SF • Consulting/training in the container space @ http://containera.io • Organizer of Docker/CoreoS meetup in Munich/Berlin
  3. Microservices? - Martin Fowler “Microservices are an approach to developing

    a single application as a suite of small, connected, services” “Loosely coupled service orientated architecture with bounded contexts” - Adrian Cockcroft
  4. None
  5. None
  6. None
  7. Microservices • Small units, composable • Single purpose • Separation

    of concerns
  8. Containers • Easy to use • Single Purpose environment •

    Fully encapsulated • Lightweight (vs VM which are ok for monoliths) • BUT: Getting complicated when you move from single host to multi-host
  9. Containers for Microservices Deployement • Scale from laptop to cloud

    • Many can be run on a single host without impacting each other • Quick to launch and kill • Easy to integrate in your CI solution • Containers are portable and lightweight
  10. Weave • Allows containers to all behave as if they

    were connected to the same physical network switch With the same interface and no application changes
  11. Single Host

  12. Multiple Hosts

  13. Multiple Clouds

  14. Real World Deployment

  15. Weave Philosophy • No need to learn an API or

    change your application • Software network layer 2 and 3. You can use your regular operational tools • No assumption about anything like which Weave node should start before another
  16. Weave Philosophy • Not a system of record: No consensus/

    synchronization protocol • Nodes don’t have to agree, things can start in any order • If your application depends on some synchronization/election, then go one level above and use Zookeeper, etcd, consul
  17. Weave features • Multi-Datacenter support • Traverse firewalls • Encrypted

    links • Multi-hop routing • Container mobility • Fault tolerance • Multicast
  18. What about Service Discovery in Microservices? • Service Discovery is

    key to micro services • DNS is a good way to keep it simple
  19. WeaveDNS • No need to do port mapping - eliminate

    use cases for service discovery • Automatically (de)register services using DNS • Container Health - WeaveDNS monitor container and remove it if it dies
  20. WeaveDNS • DNS for containers • Nothing to configure •

    nothing to maintain • no change request to submit when you need a new name for your microservice.
  21. WeaveDNS

  22. Demo Time?

  23. Demoing these features: • Extending local dev environment with Multi-host

    networking • Multi-Datacenter support • Multi-hop routing • Container mobility • Fault tolerance
  24. DEMO • Container linked on a local weave • Launch

    Weave on localhost • Service1 (weave run) ping service2 • Service2 (weave attach)
  25. Extending localhost with multi-host networking Weave Router

    Weave Router localhost Azure Cloud
  26. Container Mobility • kill Service2 and move it to cloud

    • Launch weave on Azure(weave connect from localhost to Azure) • launch Service2 with same ip as localhost
  27. Container Mobility Weave Router Weave Router localhost

    Azure Cloud Kill on localhost and re-instantiate it on Azure
  28. WeaveDNS Demo • Launch weaveDNS • Create service1 on localhost

    • Create service2 on Azure • ping service2 from service1
  29. WeaveDNS demo service1 service2 Weave Router Weave Router Weave DNS

    Weave DNS localhost Azure Cloud
  30. Failover with WeaveDNS • create service2 on DigitalOcean • kill

    service2 on Azure • ping service2 from service1 and see how service is still ping-able but IP changed
  31. FailOver using WeaveDNS service1 service2 Weave Router Weave Router Weave

    DNS Weave DNS localhost Azure Cloud service2 Weave Router Weave DNS DigitalOcean
  32. Weave Roadmap • IP Allocation Manager (IPAM): remove the burden

    of having to allocate IP for each containers • Fast Data path, improve network performance by using OpenVSwitch module in linux kernel. • Working with Docker team to create an extension API, removing need for a weave script that wrap the docker command
  33. Thank you! twitter: @romefort email: romefort@gmail.com http://news.containera.io

  34. http://weave.works