/netz

Unleash traffic control on Docker Compose systems.

Primary LanguagePythonApache License 2.0Apache-2.0

netz

Unleash traffic control on your Docker containers.

This package helps with emulating networks in distributed systems managed by Docker Compose. It uses a configuration file (netz.yml) next to the Compose file that looks like this

network-name:
  container-name:
    netem: options for netem
    htb: options for htb (class)

Integrate netz into your docker-compose.yml like this

# ...
services:
  # ...
  netz:
    image: pgorczak/netz
    # command: -v -- if you want debug output
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - .:/netz
#...

Note: Affected containers must have the NET_ADMIN capability and have the tc tool installed (part of iproute2).

Examples

Open a terminal in one of the example folders, then run docker-compose up.

Traffic control

  • You can find comprehensive info on tc at lartc.org.
  • Manpage on htb.
  • Manpage on netem.

Related