feat: add IP-based canary traffic routing support IFRFE-0 #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: add IP-based canary traffic routing support IFRFE-0
Summary
This PR implements IP-based canary traffic routing for Flagger's Istio integration, extending the existing webhook mechanism to support consistent hashing of client IPs for gradual canary traffic routing.
Key changes:
IPRangeRoutingconfiguration toCanarySpecwith support for consistent hashing strategiesIPRangeCalculatorutility package for IP range calculation and hash generationconfirm-traffic-increasewebhook to include IP range metadata in payloadIstioRouterto generate IP-basedHTTPMatchRequestrules usingX-Client-IP-HashheaderArchitecture: Uses header-based approach where gateway/ingress injects
X-Client-IP-Hashheader with hashed client IP, then Flagger matches against calculated hash ranges for routing decisions.Review & Testing Checklist for Human
🟡 Medium Risk - 4 items to verify:
Header injection dependency: Verify your gateway/ingress can inject the
X-Client-IP-Hashheader. The implementation assumes this header exists but doesn't automatically configure it - this is a critical integration requirement.Backward compatibility: Test that existing canary deployments without IP routing continue to work normally. Run a standard weighted canary rollout to ensure no regressions.
Webhook payload compatibility: Verify that external webhook consumers can handle the new IP range metadata fields in webhook payloads without breaking existing integrations.
Routing rule priority: Test scenarios where IP routing, A/B testing, and session affinity overlap to ensure routing precedence is correct and predictable.
End-to-End Test Plan
artifacts/examples/istio-ip-routing.yaml)X-Client-IP-Hash: slot-Xheader based on client IP hashNotes