fix(kubernetes): cache unstructured resources and disable deep copy#7822
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7822 +/- ##
=======================================
Coverage 73.52% 73.53%
=======================================
Files 237 237
Lines 35653 35653
=======================================
+ Hits 26214 26216 +2
+ Misses 7576 7574 -2
Partials 1863 1863 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Did you take a pprof to confirm and if so could you include the results please? |
I tried to validate this with the project’s I was able to get the benchmark harness to create the proxy LB service ( Given that, I don’t currently have a reliable way to produce meaningful before/after benchmark numbers in my environment. If you have a preferred/reliable benchmark setup (or can run |
Thanks, I see #7704, but it doesn’t include the My PR includes both pieces from the issue:
Happy to close this PR if you’d prefer to consolidate into #7704. I can cherry-pick my commits onto #7704 or open a small follow-up PR that only adds the |
fdd47ea to
ebb0b64
Compare
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@aponysus are you working on this? |
Signed-off-by: aponysus <me@joshuasorrell.com>
Signed-off-by: aponysus <me@joshuasorrell.com>
…ured cache Signed-off-by: aponysus <me@joshuasorrell.com>
ebb0b64 to
593b4dc
Compare
|
Rebasing onto upstream/main (includes merged #7704) as requested. No functional change from previous description above. |
…lready set in kubernetes.go line 89 from PR 7704. Signed-off-by: aponysus <me@joshuasorrell.com>
|
/retest |
…roxy#7822) Signed-off-by: aponysus <me@joshuasorrell.com> Signed-off-by: Sadmi Bouhafs <sadmibouhafs@gmail.com>
What type of PR is this?
fix(kubernetes)
What this PR does / why we need it:
This PR improves performance when listing unstructured extension resources by:
client.CacheOptions{Unstructured: true}on the manager client, andclient.UnsafeDisableDeepCopyon the unstructuredList()call to avoid per-object deep copies.Safety: the listed objects are treated as read-only in this path, so
UnsafeDisableDeepCopyis safe here.Scope: I intentionally did not apply
client.UnsafeDisableDeepCopyto the unstructured List ininternal/provider/kubernetes/controller.gobecauseprocessExtensionServerPoliciesmutates the listed objects (e.g., deletesstatusand later writespolicy.Object["status"]). That path would require per-item copying to remain safe.Which issue(s) this PR fixes:
Fixes #7626
Release Notes: No