Skip to content

Optimize memory footprint of csi-addons #815

@black-dragon74

Description

@black-dragon74

With the option to specify precedence in the ConfigMap, we have an opportunity to optimize the memory footprint of csi-addons.

If the precedence is set to sc-only, there is no need to watch PVC resources. The current PVC controller handles most of the heavy lifting, but it can be refactored into two separate controllers.

One controller will watch StorageClass objects, and the other will watch PersistentVolumeClaim objects. Only one of these controllers needs to run, depending on the specified precedence.

We can further reduce memory usage by watching only PartialObjectMetadata instead of the full object.

To summarize:

  • Split the controller into separate ones for StorageClass and PVC
  • Run only one controller based on the configured precedence
  • Watch only one resource Kind, not both
  • Use PartialObjectMetadata to avoid caching full objects

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions