feat: add IP-based canary traffic routing support IFRFE-0#2
Open
devin-ai-integration[bot] wants to merge 4 commits intoistio-canaryfrom
Open
feat: add IP-based canary traffic routing support IFRFE-0#2devin-ai-integration[bot] wants to merge 4 commits intoistio-canaryfrom
devin-ai-integration[bot] wants to merge 4 commits intoistio-canaryfrom
Conversation
- Add IPRangeRouting configuration to CanarySpec with consistent hashing support - Implement IPRangeCalculator utility for IP range calculation and hash generation - Extend confirm-traffic-increase webhook with IP range metadata - Add IP range matching in IstioRouter using X-Client-IP-Hash header - Support configurable hash functions (fnv, md5, sha256) and slot counts - Add comprehensive test coverage for IP routing utilities - Include example configuration for IP-based canary routing - Maintain backward compatibility with existing webhook and routing functionality Co-Authored-By: Yunpeng Han <yunpeng@moego.pet>
Author
Original prompt from Yunpeng |
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Implement attribute range routing for Istio and Kubernetes - Add new configuration options to Canary CRD - Create HeaderRangeCalculator for routing decisions- Update IstioRouter to handle attribute range routing - Add tests for new routing functionality
- Add IPRangeRouting and AttributeRangeRouting configurations to Canary CRD - Implement IP and attribute-based routing logic in Istio router - Update deployment controller to handle new routing configurations - Add tests for new routing features
- Add IPRangeRouting and AttributeRangeRouting configurations to Canary CRD - Implement IP and attribute-based routing logic in Istio router - Update deployment controller to handle new routing configurations - Add tests for new routing features
d68f2f0 to
a579fc3
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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