Load supported charts on startup and cache them globally
Summary
The Helm utility locates and loads the specified Charts (using loader.Load function) once they are requested for the first time in the reconcile loop. Further changes to the custom resource re-triggers this mechanism. With !373 (merged) we also cache the source Chart with the rendered template. Altogether the current mechanism is both process and memory inefficient.
Alternatively, we can load all the supported charts on operator startup and cache them in a way that they can be accessed globally. We trade off the slower startup time with faster and more memory efficient reconcile loop.
Context
The following discussion from !373 (merged) should be addressed:
-
@pursultani started a discussion: (+1 comment) This is inefficient we'll have multiple copies of the same chart for different instances. All supported charts can be preloaded on program startup and cached so they can be referenced globally.