Closed everettraven closed 1 year ago
I asked chapGPT about this :)
How can I introduce a CustomResourceDefinition without the controller's informer caching the CustomResources
To introduce a CustomResourceDefinition (CRD) without the controller's informer caching the CustomResources, you can set the spec.preserveUnknownFields field of the CRD to true.
When spec.preserveUnknownFields is set to true, the informer won't cache the CustomResources since it doesn't know the schema of the CustomResource's fields. This can be useful in scenarios where you want to introduce a new CRD, but you don't want to update the controller's code to handle the new schema of the CustomResource.
To set spec.preserveUnknownFields to true, you can include the following YAML snippet in your CRD manifest:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: example.mydomain.com
spec:
group: mydomain.com
version: v1alpha1
names:
kind: Example
plural: examples
scope: Namespaced
preserveUnknownFields: true
# ...
Once you apply this manifest, the controller's informer won't cache the CustomResources of the Example kind, and it will treat them as unstructured data. You can still interact with the CustomResources using the Kubernetes API, but you may need to handle the CustomResources' fields manually in your controller's code.
☝🏽 that fits in the fbc as an api @joelanford is talking about too
Related memory issue here: #22
I think this is done, but it would probably be worth running through and evaluating this again and updating the pprof/README.md file to contain more up to date stats
There have been quite a few changes since this issue was opened and would likely require another analysis of memory consumption prior to being able to make any optimizations. I'm going to close this as "obsolete" for now, but if folks feel this has been closed incorrectly please feel free to comment tagging me to reopen
Based on the initial findings from #3 we noticed that there is a fairly large and persistent memory consumption increase (~232Mi) in the CatalogSource controller after reconciling a CatalogSource CR and creating the children Package and BundleMetadata CRs.
This increase in memory consumption is likely caused by the CatalogSource controller caching these child resources (which there can be a large number of). We should explore methods we can use to decrease the memory consumption to prevent the
CatalogSource
controller from hogging large amounts of memory.Additional Context: