This PR prevents instantiating the REST client multiple times. In our current configuration, helm discovery actively allocates memory, which makes GC executions more frequent. The full description can be found here.
Benchmark results for getting the REST client with the previously used env getter and the new persistent getter:
Requires deep testing because this can lead to issues in cases when CRDs are deployed to the cluster, which means new resource types are dynamically added to a cluster.
Another way to solve the problem is to use a single client for all operations with Kubernetes.
Overview
What this PR does / why we need it
This PR prevents instantiating the REST client multiple times. In our current configuration, helm discovery actively allocates memory, which makes GC executions more frequent. The full description can be found here.
Benchmark results for getting the REST client with the previously used env getter and the new persistent getter:
Special notes for your reviewer
Requires deep testing because this can lead to issues in cases when CRDs are deployed to the cluster, which means new resource types are dynamically added to a cluster.
Another way to solve the problem is to use a single client for all operations with Kubernetes.
Does this PR introduce a user-facing change?