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

Networking and Service Discovery for all contai...

Networking and Service Discovery for all containers runtimes [rkt and Docker]

Ilya Dmitrichenko

April 27, 2016
Tweet

More Decks by Ilya Dmitrichenko

Other Decks in Technology

Transcript

  1. Outline • Intro to rkt • Motivation • why do

    I need a container network? • why to use Weave Net? • How Weave Net works • comparison to other solutions • Demo (rkt & Docker on GCE + Docker for Mac)
  2. I know Docker, what’s rkt? • rkt is a container

    runtime built by CoreOS • rkt is somewhat less opinionated then Docker • Docker uses runC, which is similar to rkt • rkt has a simpler architecture • rkt is easier to use as a building block • rkt can run Docker images
  3. Why do I need a container network? • you may

    want to use an orchestrator • some orchestrators require a network • options vary, depending on cloud provider • you need something that just works
  4. Why chose Weave Net? • works with any orchestrator (or

    without one) • provides unique IP for each container • has simple service discovery built-in • easy to setup and manage • works with all runtimes, as you will see • works the same in any cloud
  5. What do you mean by any orchestrator? • Kubernetes •

    EC2 Container Service • Docker Swarm • Apache Mesos • DC/OS
  6. How does Weave Net work? • lightweight micro-SDN • resilient

    mesh architecture • uses L2/VXLAN, supports multicast • no external config store required • all state leave on the network
  7. How does service discovery work? • fast in-memory DNS •

    simply find containers by name • no port number lookup • no port remapping • no code changes
  8. How does it compare? • using client-side lookup is not

    easy to implement and hard to debug • SRV record or directory lookup • e.g.: Consul, Zookeeper, etcd • wrapping service discovery into proxy config is not optimal and even harder to debug • e.g.: multitude of bespoke code on Github
  9. Step 1: Infrastructure Setup Let's say you'd like to have

    a cluster of 3 hosts with Docker installed • $CONTAINERS_1, $CONTAINERS_2, $CONTAINERS_3
  10. Step 2: Install Weave Net On all of the machines

    run: sudo curl --location --silent git.io/weave \ --output /usr/local/bin/weave sudo chmod +x /usr/local/bin/weave
  11. Step 3: Launch Weave Net On all of the machines

    run: weave launch \ $CONTAINERS_1 $CONTAINERS_2 $CONTAINERS_3 eval $(weave env)
  12. Step 3: Run your apps On each hosts run these

    commands on any host: docker run -d \ —-name=svc-a image docker run -d \ —-name=svc-b image docker run -d alpine ping -c3 svc-a docker run -d alpine ping -c3 scc-b