-
Notifications
You must be signed in to change notification settings - Fork 80
Build upstreams from EndpointSlices #310
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
After some more testing, I noticed the informer cache shifts results every now and then. I suspect periodic reconciliation. This caused the output to shift as well, and frequent reloads. I now sort the informer results before processing. I also added a simple helper to limit logging of warning messages generated by plugins, so it is safe to log from plugins even though they run quite often. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #310 +/- ##
==========================================
+ Coverage 20.11% 21.97% +1.85%
==========================================
Files 30 33 +3
Lines 1397 1502 +105
==========================================
+ Hits 281 330 +49
- Misses 1114 1159 +45
- Partials 2 13 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This replaces our own Store.Ingresses list with a method Ingresses() that derives the list from the informer cache. This also adds a ResourceEventHandler implementation that automatically submits via the queue. The intention is to reduce boilerplate as we add more informers to the code.
The isManagedTLSSecret helper relied on ingresses, but wasn't checked on an update to ingresses. This instead moves all checks to the plugin. In addition, creating a secret informer builds a cache of all secrets in memory. This is undesirable, because it means we keep around sensitive data from completely unrelated secrets. Instead, a transform is installed on the informer to throw away all secret data, so we only keep metadata. The plugin is then responsible for fetching actual secret data for only the secrets we need. In practice, we are still dependant on the Go garbage collector.
I rebased this on main and fixed the conflicts. Did some testing and still good in my setup. |
This ensures output is consistent when there are no changes, and fixes spurious reloads.
I didn't notice the failing test, but it was simply missing permissions for watching EndpointSlices in the chart. That's fixed now. |
An attempt at #7.
This generalizes the informer code so adding more informers doesn't involve a bunch of boilerplate. It then adds the Service and EndpointSlice informers necessary to keep the upstreams updated.
This also includes some work on secrets, to try keep them out of memory, because the informer normally builds a cache of everything. Especially without
-namespace
, we were just kinda keeping around every secret anywhere in the cluster in memory.