8000 fix image name by alexei-led · Pull Request #269 · alexei-led/pumba · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix image name #269

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

Merged
merged 1 commit into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 33 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Pumba is a chaos testing command line tool for Docker containers.
Pumba disturbs your containers by:

- Crashing containerized applications
- Emulating network failures (latency, packet loss, etc.)
- Manipulating both incoming and outgoing network traffic
Expand Down Expand Up @@ -171,7 +172,7 @@ OPTIONS:
--duration value, -d value network emulation duration; should be smaller than recurrent interval; use with optional unit suffix: 'ms/s/m/h'
--interface value, -i value network interface to apply delay on (default: "eth0")
--target value, -t value target IP filter; comma separated. netem will impact only on traffic to target IP(s)
--tc-image value Docker image with tc (iproute2 package); try 'ghcr.io/alexei-led/pumba/pumba-debian-nettools'
--tc-image value Docker image with tc (iproute2 package); try 'ghcr.io/alexei-led/pumba-debian-nettools'
--help, -h show help
```

Expand Down Expand Up @@ -363,14 +364,15 @@ pumba netem --duration 5m corrupt --percent 10 mydb
# Using the multi-arch nettools image explicitly
# This is useful when you need to ensure both netem and iptables commands use the same image

pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 5m \
delay --time 1000 \
--jitter 100 \
myapp
```

For more examples of combining netem with iptables commands, see the [Advanced Network Chaos Scenarios](#advanced-network-chaos-scenarios) section.
For more examples of combining netem with iptables commands, see the [Advanced Network Chaos Scenarios](#advanced-network-chaos-scenarios)
section.

##### Network Tools Images

Expand All @@ -389,24 +391,27 @@ You have two options:

By default, Pumba now uses multi-tool container images that include both `tc` and `iptables` tools:

- `ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest` - Alpine-based image with both tc and iptables
- `ghcr.io/alexei-led/pumba/pumba-debian-nettools:latest` - Debian-based image with both tc and iptables
- `ghcr.io/alexei-led/pumba-alpine-nettools:latest` - Alpine-based image with both tc and iptables
- `ghcr.io/alexei-led/pumba-debian-nettools:latest` - Debian-based image with both tc and iptables

These images provide several benefits:

- **Efficiency**: Both the `netem` and `iptables` commands can use the same container image
- **Multi-architecture**: Images are built for both `amd64` and `arm64` architectures
- **Command reuse**: A neutral entrypoint keeps the helper container alive between commands

**Usage Example**:

```bash
# Use the same nettools image for both netem and iptables commands
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest delay --time 100 mycontainer
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest loss --probability 0.2 mycontainer
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest delay --time 100 mycontainer
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest loss --probability 0.2 mycontainer
```

#### Architecture Support

The nettools images are built for multiple CPU architectures:

- `amd64` (x86_64) - Standard 64-bit Intel/AMD architecture
- `arm64` (aarch64) - 64-bit ARM architecture (Apple M1/M2, AWS Graviton, etc.)

Expand Down Expand Up @@ -468,7 +473,7 @@ OPTIONS:
--destination value, --dest value destination IP filter; supports multiple IPs; supports CIDR notation
--src-port value, --sport value source port filter; supports multiple ports (comma-separated)
--dst-port value, --dport value destination port filter; supports multiple ports (comma-separated)
--iptables-image value Docker image with iptables and tc tools (default: "ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest")
--iptables-image value Docker image with iptables and tc tools (default: "ghcr.io/alexei-led/pumba-alpine-nettools:latest")
--pull-image force pull iptables-image
--help, -h show help
```
Expand All @@ -493,7 +498,8 @@ OPTIONS:

#### Using the `iptables` Commands

Pumba's `iptables` command allows you to simulate packet loss for incoming network traffic, with powerful filtering options. This can be used to test application resilience to network issues.
Pumba's `iptables` command allows you to simulate packet loss for incoming network traffic, with powerful filtering options. This can be
used to test application resilience to network issues.

##### Examples

Expand Down Expand Up @@ -525,34 +531,36 @@ You have two options:

1. Make sure the target container has the `iptables` tool installed
(install the `iptables` package)

2. Use the `--iptables-image` option to specify a Docker image with
the `iptables` tool.

Pumba will create a helper container from this image with `NET_ADMIN`
capability and reuse the target container's network stack.

The recommended images are:
- `ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest` (Alpine-based)
- `ghcr.io/alexei-led/pumba/pumba-debian-nettools:latest` (Debian-based)
- `ghcr.io/alexei-led/pumba-alpine-nettools:latest` (Alpine-based)
- `ghcr.io/alexei-led/pumba-debian-nettools:latest` (Debian-based)

Both images support multiple architectures (amd64, arm64).

### Advanced Network Chaos Scenarios

Pumba allows you to create complex and realistic network chaos scenarios by combining multiple network manipulation commands. This is particularly useful for simulating real-world network conditions where multiple issues might occur simultaneously.
Pumba allows you to create complex and realistic network chaos scenarios by combining multiple network manipulation commands. This is
particularly useful for simulating real-world network conditions where multiple issues might occur simultaneously.

#### Asymmetric Network Conditions

In real networks, upload and download speeds/quality often differ. You can simulate this using a combination of `netem` for outgoing traffic and `iptables` for incoming traffic:
In real networks, upload and download speeds/quality often differ. You can simulate this using a combination of `netem` for outgoing traffic
and `iptables` for incoming traffic:

```bash
# Add delay to outgoing traffic (slow uploads)
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 5m delay --time 500 myapp &

# Add packet loss to incoming traffic (unreliable downloads)
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 5m loss --probability 0.1 myapp &
```

Expand All @@ -562,11 +570,11 @@ Test how your application handles multiple concurrent network issues:

```bash
# Limit bandwidth and add packet corruption
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 10m rate --rate 1mbit myapp &

# Add packet loss to incoming traffic
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 10m loss --probability 0.05 myapp &
```

Expand All @@ -576,19 +584,20 @@ Use Pumba to test how your microservices architecture responds to network failur

```bash
# Add high latency between service A and service B
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--target service-b-ip --duration 5m delay --time 2000 --jitter 500 service-a &

# Add packet loss from service B to service C
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--source service-c-ip --duration 5m loss --probability 0.2 service-b &
```

#### Example Script

You can find a complete example script for combined chaos testing in the [examples directory](examples/pumba_combined.sh).

For detailed guidance on advanced network chaos testing scenarios, best practices, and troubleshooting, see the [Advanced Network Chaos Testing Documentation](docs/advanced-network-chaos.md).
For detailed guidance on advanced network chaos testing scenarios, best practices, and troubleshooting, see
the [Advanced Network Chaos Testing Documentation](docs/advanced-network-chaos.md).

### Stress testing Docker containers

Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func initializeCLICommands() []cli.Command {
cli.StringFlag{
Name: "tc-image",
Usage: "Docker image with tc (iproute2 package) and iptables",
Value: "ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest",
Value: "ghcr.io/alexei-led/pumba-alpine-nettools:latest",
},
cli.BoolTFlag{
Name: "pull-image",
Expand Down Expand Up @@ -366,7 +366,7 @@ func initializeCLICommands() []cli.Command {
cli.StringFlag{
Name: "iptables-image",
Usage: "Docker image with iptables and tc (iproute2 package)",
Value: "ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest",
Value: "ghcr.io/alexei-led/pumba-alpine-nettools:latest",
},
cli.BoolTFlag{
Name: "pull-image",
Expand Down
2 changes: 1 addition & 1 deletion deploy/pumba_kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
- --duration
- 20s
- --tc-image
- ghcr.io/alexei-led/pumba/pumba-debian-nettools
- ghcr.io/alexei-led/pumba-debian-nettools
- delay
- --time
- "3000"
Expand Down
77 changes: 40 additions & 37 deletions docs/advanced-network-chaos.md
10000
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ This guide provides detailed instructions for creating advanced network chaos te

## Overview

Pumba now offers support for both outgoing traffic manipulation (using `tc` with `netem`) and incoming traffic manipulation (using `iptables`). By combining these tools, you can create more realistic and complex network chaos scenarios.
Pumba now offers support for both outgoing traffic manipulation (using `tc` with `netem`) and incoming traffic manipulation (using
`iptables`). By combining these tools, you can create more realistic and complex network chaos scenarios.

![Pumba Network Chaos Testing](img/nettools-diagram.svg)

The diagram above illustrates how Pumba uses a single nettools container to manipulate both incoming traffic (via iptables) and outgoing traffic (via tc/netem) for the target application container.
The diagram above illustrates how Pumba uses a single nettools container to manipulate both incoming traffic (via iptables) and outgoing
traffic (via tc/netem) for the target application container.

## Nettools Images

Pumba uses multi-architecture container images that include both `tc` and `iptables` tools:

- `ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest` - Alpine-based (smaller size)
- `ghcr.io/alexei-led/pumba/pumba-debian-nettools:latest` - Debian-based (better compatibility)
- `ghcr.io/alexei-led/pumba-alpine-nettools:latest` - Alpine-based (smaller size)
- `ghcr.io/alexei-led/pumba-debian-nettools:latest` - Debian-based (better compatibility)

Both images support:

- amd64 (x86_64) architecture
- arm64 (aarch64) architecture

Expand All @@ -29,13 +32,13 @@ In real networks, upload and download characteristics often differ. You can simu

```bash
# Slow uploads: Add 500ms delay to outgoing traffic
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 5m \
delay --time 500 --jitter 50 \
myapp &

# Unreliable downloads: Add 10% packet loss to incoming traffic
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 5m \
loss --probability 0.1 \
myapp &
Expand All @@ -47,13 +50,13 @@ Test how your application handles both bandwidth limitations and occasional pack

```bash
# Limit bandwidth to 1Mbit/s
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 10m \
rate --rate 1mbit \
myapp &

# Add 5% packet loss to incoming traffic
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 10m \
loss --probability 0.05 \
myapp &
Expand All @@ -65,13 +68,13 @@ You can target specific protocols for different types of network chaos:

```bash
# Add latency to all outgoing HTTP traffic
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 15m \
delay --time 200 \
myapp &

# Drop 20% of incoming UDP packets only
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--duration 15m \
--protocol udp \
loss --probability 0.2 \
Expand All @@ -84,14 +87,14 @@ Test how your microservices handle degraded network conditions between specific

```bash
# Add high latency between Service A and Service B
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--target service-b-ip \
--duration 10m \
delay --time 1000 --jitter 200 \
service-a &

# Add packet loss from Service B to Service C
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--source service-c-ip \
--duration 10m \
loss --probability 0.15 \
Expand All @@ -104,14 +107,14 @@ You can target specific ports to simulate more targeted network issues:

```bash
# Add packet corruption to outgoing database traffic (port 5432)
pumba netem --tc-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba netem --tc-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--target db-server-ip \
--duration 5m \
corrupt --percent 5 \
myapp &

# Add packet loss to incoming HTTP traffic (port 80)
pumba iptables --iptables-image ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest \
pumba iptables --iptables-image ghcr.io/alexei-led/pumba-alpine-nettools:latest \
--dst-port 80 \
--duration 5m \
loss --probability 0.1 \
Expand All @@ -128,29 +131,29 @@ spec:
template:
spec:
containers:
- name: pumba-netem
image: gaiaadm/pumba:latest
args:
- --random
- --interval=30s
- netem
- --tc-image=ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest
- --duration=5m
- delay
- --time=500
- "re2:app-.*"
- name: pumba-iptables
image: gaiaadm/pumba:latest
args:
- --random
- --interval=30s
- iptables
- --iptables-image=ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest
- --duration=5m
- --protocol=tcp
- loss
- --probability=0.1
- "re2:app-.*"
- name: pumba-netem
image: gaiaadm/pumba:latest
args:
- --random
- --interval=30s
- netem
- --tc-image=ghcr.io/alexei-led/pumba-alpine-nettools:latest
- --duration=5m
- delay
- --time=500
- "re2:app-.*"
- name: pumba-iptables
image: gaiaadm/pumba:latest
args:
- --random
- --interval=30s
- iptables
- --iptables-image=ghcr.io/alexei-led/pumba-alpine-nettools:latest
- --duration=5m
- --protocol=tcp
- loss
- --probability=0.1
- "re2:app-.*"
```

## Best Practices
Expand Down
2 changes: 1 addition & 1 deletion examples/pumba_combined.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# to create more complex and realistic network chaos scenarios.

# Common image for both commands
NETTOOLS_IMAGE="ghcr.io/alexei-led/pumba/pumba-alpine-nettools:latest"
NETTOOLS_IMAGE="ghcr.io/alexei-led/pumba-alpine-nettools:latest"

# Pull the image in advance (optional)
docker pull $NETTOOLS_IMAGE
Expand Down
2 changes: 1 addition & 1 deletion examples/pumba_delay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -o xtrace
pumba netem delay --help
read -p "Press enter to continue"

pumba --log-level=info --interval=20s netem --tc-image=ghcr.io/alexei-led/pumba/pumba-debian-nettools --duration=10s delay --time=3000 --jitter=20 ping
pumba --log-level=info --interval=20s netem --tc-image=ghcr.io/alexei-led/pumba-debian-nettools --duration=10s delay --time=3000 --jitter=20 ping
2 changes: 1 addition & 1 deletion examples/pumba_loss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -o xtrace
pumba netem loss --help
read -p "Press enter to continue"

pumba --log-level=info netem --duration 20s --tc-image ghcr.io/alexei-led/pumba/pumba-debian-nettools --percent 20 client
pumba --log-level=info netem --duration 20s --tc-image ghcr.io/alexei-led/pumba-debian-nettools --percent 20 client
Loading
Loading
0