- 
                Notifications
    You must be signed in to change notification settings 
- Fork 37
[PROPOSAL] Do not modify weight for canaryBackendRefs in managed route rules #115
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
base: main
Are you sure you want to change the base?
Conversation
907a695    to
    a3eae60      
    Compare
  
    | headerBasedRouteValue := rules[HEADER_BASED_RULE_INDEX].Matches[HEADER_BASED_MATCH_INDEX].Headers[HEADER_BASED_HEADER_INDEX] | ||
| weight := *rules[HEADER_BASED_RULE_INDEX].BackendRefs[HEADER_BASED_BACKEND_REF_INDEX].Weight | ||
| return weight == targetWeight && isHeaderBasedHTTPRouteValuesEqual(headerBasedRouteValue, targetHeaderBasedRouteValue) | ||
| return weight == DEFAULT_ROUTE_WEIGHT && isHeaderBasedHTTPRouteValuesEqual(headerBasedRouteValue, targetHeaderBasedRouteValue) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes assertion that the headerBasedRoute rule that the gateway-api owns is not modified to anything except for the default weight value for the CRD: 1.
a3eae60    to
    b74f598      
    Compare
  
    | It would be great if there was a full example at https://github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/tree/main/examples that people can test and compare behavior with/without this PR implemented. | 
Signed-off-by: Dylan Schlager <[email protected]>
Signed-off-by: Dylan Schlager <[email protected]>
6efa5d8    to
    1cbf7ff      
    Compare
  
    | 
 sure thing, I've pushed that to this branch | 
| I wonder if that might also be related to the timeout on the E2E tests that just ran again from my push to the examples directory. Considering they passed on the previous commit for the actual code changes, this seems like it could be a pretty consistent flake/race condition. I wonder how we could ensure that when we're operating on  Maybe we don't commit changes to the HTTPRoute on  | 
Signed-off-by: Dylan Schlager <[email protected]>

Related to thread in CNCF slack here: https://cloud-native.slack.com/archives/C01U781DW2E/p1741202571985169
I don't believe that we should be modifying the weight of a
canaryBackendRefwhen that ref is inside of a rule that we've previously created fromsetHeaderRoute.In the current state, doing a
setHeaderRoutestep while weight is0(i.e. after you'vesetCanaryScaleand expect to expose a route to the canary service for a specific header ONLY, while still directing 100% of traffic to the stable backend) will cause any requests with that header to 504.This is because
setWeightis reconciled consistently, and will match the newly created rule for the header route as viable for updating theweightto 0. When that weight is is not a positive integer, requests will be dropped because there is no alternative backendRef to send those requests to.In the istio configuration, you can see that when reconciling the weight, it only does so if
httpRoute.Mirror != nilotherwise it will make no changes.Since
setMirrorRouteis not implemented in the gateway-api-plugin, yet, there is no risk in skipping allcanaryBackendRef's that are part of managed rules.However - when
setMirrorRoutedoes get implemented, we will need to make sure that managed MIRROR routes have their backendRefs updated.In the current structure of the configmap for recording the managed routes, there is not any distinction between these types of managed routes.
One solution here would be to use a different HTTPConfigMapKey for mirror routes than we do header routes, and this will continue to function as expected.
i.e.
becomes
and so on and so forth for GRPC and TCP.
Remaining in this proposal would be the changes to the GRPC and TCP route code for those functions, which I can add if this approach is sound.