Skip to content

Optimize configMap cache usage in repeated reconciles without changes #133

Open
kubernetes-sigs/cluster-api-operator
#827
@Danil-Grigorev

Description

@Danil-Grigorev

When the CAPIProvider resource removes the applyHash annotation from the applied CAPI Operator provider, the operator code unnecessarily initiates a full reconciliation cycle. This cycle involves constructing an unnecessary files cache and performing costly processing, conversions, and replacements, as demonstrated in the profiling stub.

Since the configuration map with the data has already been created and won’t change during this cycle, reconciliation shouldn’t occur.

To address this we should store the templated and fully modified content of the provider manifests in a secret and use this secret as cache instead. In addition to that that secret should act as a source for hash notation which now needs to be calculated based on secret data.

This change would reduce the need to perform memory-intensive managers construction, which caches file content and requires upstream modifications.

Current approach is implemented in kubernetes-sigs/cluster-api-operator#827

Outstanding work:

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions