Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pumba netem command with docker network not working #137

Open
sayankc opened this issue Oct 30, 2019 · 8 comments
Open

pumba netem command with docker network not working #137

sayankc opened this issue Oct 30, 2019 · 8 comments
Labels

Comments

@sayankc
Copy link

sayankc commented Oct 30, 2019

Hi ,
My requirement is to create a docker container within a specific docker network and apply network chaos only on that network, so that other applications running on the host is not impacted.
Here is what I have done. But the delay is not working. only working with --interface eth0.

  1. create a docker network.
    docker network create -d bridge --subnet 172.25.0.0/16 isolated_nw44

  2. Run a docker container in this network.
    docker run -d -p 4444:4444 -v /dev/shm:/dev/shm --name=container44 --network=isolated_nw44 --ip=172.25.3.3 selenium/standalone-chrome

  3. check the network interface created, where the docker container is.
    ip addr | grep 172.25 ==> inet 172.25.0.1/16 scope global br-72aff75d4744

  4. Now applying netem on the new interface (br-72aff75d4744)
    ./pumba_linux_amd64.v0.6.5 netem --duration 5m --interface br-72aff75d4744 --tc-image gaiadocker/iproute2 delay --time 1000 container44

Result : It is not resulting any additional delay for the URL(http://ipadderss-of-host:4444/)

  1. If I apply following command, netem is applying the delay but entire box network is impacted.
    ./pumba_linux_amd64.v0.6.5 netem --duration 5m --interface eth0 --tc-image gaiadocker/iproute2 delay --time 1000 container44
@alexei-led
Copy link
Owner

@sayankc I will check it.
Did you check with network interface assigned to your container (container44) binded to isolated_nw44 network?

@alexei-led alexei-led added the bug label Oct 31, 2019
@sayankc
Copy link
Author

sayankc commented Nov 4, 2019

hi @alexei-led ,
I checked with isolated_nw44 too. Same result. network delay is not reflecting for the docker network.
./pumba_linux_amd64.v0.6.5 netem --duration 5m --interface isolated_nw44 --tc-image gaiadocker/iproute2 delay --time 1000 container44

@sayankc
Copy link
Author

sayankc commented Feb 6, 2020

Hi @alexei-led ,
Could you please let me know if it is fixed / planned to be fixed in next release.

@alexei-led
Copy link
Owner

Hi @sayankc
Can you, please, post here output from ifconfig command running inside container44.

@alexei-led
Copy link
Owner

@sayankc does it work now? can I close the issue?

@sayankc
Copy link
Author

sayankc commented Feb 12, 2020

@alexei-led , Issue is still there. I'll give you ifconfig.

@ebcFlagman
Copy link

ebcFlagman commented Nov 23, 2022

I've the same issue.
Here's my docker-compose to reproduce:

version: '3'
services:
  web:
    image: nginx
  pinger:
    image: alpine
    command: "ping web"
  pumba:
    image: gaiaadm/pumba
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: "--log-level debug netem --tc-image gaiadocker/iproute2 --duration 1m delay --time 5000 pumba-pinger-1"

@GruenerT
Copy link

GruenerT commented Dec 18, 2023

Has there been a solution to this?

My own setup didn't work, but neither did the demo here:
https://github.com/alexei-led/pumba?tab=readme-ov-file#demo

My setup is running inside windows10 wsl2.

FROM ubuntu:latest

RUN apt-get update && \
  apt-get install -y iproute2 iputils-ping net-tools socat && \
  apt-get install -y bash kmod

CMD ["socat","tcp-listen:26379,reuseaddr,fork","tcp:redis-cache-layer:6379"]

then using
pumba netem --interface eth0 --duration 1h --tc-image gaiadocker/iproute2 delay --time 3000 latency-simulator

No delay is applied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants