OCPBUGS-64575: Refresh egress IP capacity annotation on informer resync#254
OCPBUGS-64575: Refresh egress IP capacity annotation on informer resync#254ssonigra wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ssonigra The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
WalkthroughThe node informer update handler now enqueues same- ChangesNode informer processing
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
When we assign an IP to the node the capacity of the node is not updated by the cncc until the pod is restarted this fix will solve that problem |
|
@ssonigra: This pull request references Jira Issue OCPBUGS-64575, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
2200608 to
3c51d91
Compare
The node controller's UpdateFunc only enqueued nodes when taints changed. The 2-minute informer resync fires UpdateFunc with old==new (same cached object), but since taints never differ in that case, the node was never re-enqueued. This meant SyncHandler — which makes live cloud API calls to calculate current IP capacity — only ran once at node add time. As a result, the cloud.network.openshift.io/egress-ipconfig annotation became stale immediately after the initial calculation. When EgressIPs were assigned or released (changing the ENI's IP count), the annotation continued to report the original capacity. This caused ovn-kubernetes to make incorrect assignment decisions based on outdated capacity data. Fix: detect informer resync events (where old and new have the same ResourceVersion) and enqueue the node so SyncHandler re-queries the cloud API with the current set of CPIC-managed IPs, producing an accurate capacity annotation. Signed-off-by: Saurab Sonigra <ssonigra@redhat.com>
3c51d91 to
182ac47
Compare
|
/retest |
|
@ssonigra: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
UpdateFunconly enqueued nodes on taint changes, causingSyncHandlerto run only once at node add timeold==newmeans taints never differcloud.network.openshift.io/egress-ipconfigannotation stale — capacity never updated as EgressIPs were assigned or releasedResourceVersion) and enqueue the node soSyncHandlerre-queries the cloud API with current CPIC stateRoot Cause
When an EgressIP is assigned, CNCC adds the IP to the cloud ENI via
CloudPrivateIPConfig, but never recalculates the node's capacity annotation. ThegetCapacity()function correctly excludes CPIC-managed IPs, but it's only called fromSyncHandler, which only ran at node add time (when no CPICs existed yet). This meant all IPs on the ENI — including later-assigned EgressIPs — were counted as "non-CPIC" in the stale annotation, double-reducing available capacity.Test plan
🤖 Generated with Claude Code