Skip to content

v0.6.0-SURE-6125.4

@moio moio tagged this 02 May 20:02
Helm has a pluggable Storage engine where it stores the history
of deployments. fleet-agent invokes Helm methods to retrieve
the history of deployments from it.

The default Storage implementation, unless otherwise configured,
is Kubernetes Secrets. Because Helm is supposed to be used as
a command line, interactive program, none of those Secrets are
cached (a REST Client is used to retrieve them).

The BundleDeployment controller fires four methods at every change,
and three of them (Trigger(), DeployBundle() and MonitorBundle())
eventually call Storage.History() four times for each bundle.
Even in absence of changes, all those calls happen at least once
per MonitorBundleDelay (5 minutes) per BundleDeployment because
of the periodic enqueuing performed by MonitorBundle().

Calls to Storage.History() generate significant CPU and RAM load to
the Kubernetes API server, etcd, and fleet-agent itself as the
retrieval of those Secrets, which are typically big in size, is
expensive. Moreover significant computation is done after
retrieval in Helm code.

This patch caches Storage.History() results for reuse, refreshing
them every 5 minutes.

Signed-off-by: Silvio Moioli <silvio@moioli.net>
Assets 2
Loading