-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[forge] Mainnet Like Network Simulation (#7533)
This PR adds the ability to simulate as close to a real network as possible in Forge. It adds a new NetEm config that can support emulating delay, loss, corruption, bandwidth between any two targets within the same test, overcoming existing drawbacks where multiple chaos simulations couldn't be stacked. This provides the MultiRegionNetworkEmulationTest which enables simulating a multi-region network and optionally add chaos between nodes in the same region group. Also, CpuChaosTest enables stressing the CPU to mimic varying CPU cores between validators.
- Loading branch information
1 parent
6267ea1
commit fa618bc
Showing
9 changed files
with
601 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: StressChaos | ||
metadata: | ||
namespace: {namespace} | ||
name: {name} | ||
spec: | ||
mode: all | ||
selector: | ||
namespaces: | ||
- {namespace} | ||
expressionSelectors: | ||
- {{ key: app.kubernetes.io/instance, operator: In, values: [{instance_labels}] }} | ||
stressors: | ||
cpu: | ||
workers: {num_workers} | ||
load: {load_per_worker} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: NetworkChaos | ||
metadata: | ||
namespace: {namespace} | ||
name: {name} | ||
spec: | ||
action: netem | ||
mode: all | ||
selector: | ||
namespaces: | ||
- {namespace} | ||
expressionSelectors: | ||
- {{ key: app.kubernetes.io/instance, operator: In, values: [{instance_labels}] }} | ||
delay: | ||
latency: "{delay_latency_ms}ms" | ||
correlation: "{delay_correlation_percentage}" | ||
jitter: "{delay_jitter_ms}ms" | ||
loss: | ||
loss: "{loss_percentage}" | ||
correlation: "{loss_correlation_percentage}" | ||
bandwidth: | ||
rate: "{rate}mbps" | ||
limit: 20971520 # placeholder value. not supported by tc netem | ||
buffer: 10000 # placeholder value. not supported by tc netem | ||
direction: both | ||
target: | ||
selector: | ||
namespaces: | ||
- {namespace} | ||
expressionSelectors: | ||
- {{ key: app.kubernetes.io/instance, operator: In, values: [{target_instance_labels}] }} | ||
mode: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.