Skip to content

Conversation

@aymericDD
Copy link
Contributor

@aymericDD aymericDD commented Dec 19, 2025

What does this PR do?

  • Adds new functionality
  • Alters existing functionality
  • Fixes a bug
  • Improves documentation or testing

Please briefly describe your changes as well as the motivation behind them:

This PR implements percentage-based IP selection for network disruptions, enabling users to target only a specific percentage (1-100%) of resolved IPs for both hosts and services.

Key Features:

  • Uses SHA-256 consistent hashing for deterministic IP selection
  • Ensures the same IP subset is selected across all chaos pods within a single disruption run using Kubernetes Disruption UID as seed
  • Supports both hosts and services
  • Includes validation for percentage range (1-100)

Motivation:

  • Gradual Impact: Start with smaller disruption percentages to minimize blast radius (e.g., disrupt 10% of IPs first, then increase)
  • A/B Testing: Compare behavior between disrupted and non-disrupted IP subsets
  • Load Balancing Scenarios: Test how applications handle partial endpoint failures in load-balanced services
  • Consistency: Predictable behavior across distributed chaos pods using the same seed within a disruption run

Code Quality Checklist

  • The documentation is up to date.
  • My code is sufficiently commented and passes continuous integration checks.
  • I have signed my commit (see Contributing Docs).

Testing

  • I leveraged continuous integration testing
    • by depending on existing unit tests or end-to-end tests.
    • by adding new unit tests or end-to-end tests.
  • I manually tested the following steps:
    - Created example manifest (network_dns_resolver_control.yaml) demonstrating percentage-based selection
    - Tested with 50% host disruption and 30% service disruption scenarios
    - Verified consistency: same IPs selected across multiple chaos pods within same disruption
    - Verified variability: different IPs selected when disruption is recreated (new Disruption UID)
    - Validated backward compatibility: existing disruptions work without modifications (defaults to 100%)
    - [x] locally.
    - [ ] as a canary deployment to a cluster.

Resolve issue: #843

Copy link
Contributor Author

aymericDD commented Dec 19, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@aymericDD aymericDD changed the title feat(network): add percentage-based IP selection [CHAOSPLT-259][FEATURE][CHAOS] Add percentage-based IP selection for network disruptions Dec 19, 2025
@aymericDD aymericDD changed the title [CHAOSPLT-259][FEATURE][CHAOS] Add percentage-based IP selection for network disruptions [CHAOSPLT-259] Add percentage-based IP selection for network disruptions Dec 19, 2025
@datadog-official
Copy link

datadog-official bot commented Dec 19, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6f36370 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@aymericDD aymericDD force-pushed the aymeric.daurelle/CHAOSPLT-259/feat branch from 26cf119 to e32b4dc Compare December 22, 2025 10:11
@aymericDD aymericDD requested a review from a team December 22, 2025 10:21
@aymericDD aymericDD force-pushed the aymeric.daurelle/CHAOSPLT-1360/fix branch from 10db19f to fcbc91d Compare December 22, 2025 13:09
@aymericDD aymericDD force-pushed the aymeric.daurelle/CHAOSPLT-259/feat branch from e32b4dc to f9c5119 Compare December 22, 2025 13:09
@aymericDD aymericDD force-pushed the aymeric.daurelle/CHAOSPLT-1360/fix branch from fcbc91d to e363d15 Compare December 22, 2025 20:06
@aymericDD aymericDD force-pushed the aymeric.daurelle/CHAOSPLT-259/feat branch 2 times, most recently from 766b11f to 28c876d Compare December 22, 2025 20:27
@aymericDD aymericDD force-pushed the aymeric.daurelle/CHAOSPLT-1360/fix branch from e363d15 to 1a19143 Compare December 22, 2025 20:27
Implements consistent hashing for selecting subsets of IPs
based on percentage configuration in network disruptions.
Enables deterministic IP selection across chaos pods.

- Add SelectIPsByPercentage with SHA256-based hashing
- Ensure consistent selection using seed parameter
- Add comprehensive test coverage for edge cases
- Add example demonstrating DNS resolver control

Jira: CHAOSPLT-259
@aymericDD aymericDD force-pushed the aymeric.daurelle/CHAOSPLT-259/feat branch from 28c876d to 6f36370 Compare December 22, 2025 20:42
@aymericDD aymericDD marked this pull request as ready for review December 22, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants