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
Tweet

More Decks by Johann Romefort

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. Weave features • Multi-Datacenter support • Traverse firewalls • Encrypted

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

    key to micro services • DNS is a good way to keep it simple
  10. 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
  11. WeaveDNS • DNS for containers • Nothing to configure •

    nothing to maintain • no change request to submit when you need a new name for your microservice.
  12. Demoing these features: • Extending local dev environment with Multi-host

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

    Weave on localhost • Service1 (weave run) ping service2 • Service2 (weave attach)
  14. 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
  15. Container Mobility 10.2.1.1 10.2.1.3 Weave Router Weave Router 10.2.1.2 localhost

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

    • Create service2 on Azure • ping service2 from service1
  17. 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
  18. FailOver using WeaveDNS service1 service2 Weave Router Weave Router Weave

    DNS Weave DNS localhost Azure Cloud service2 Weave Router Weave DNS DigitalOcean
  19. 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