Skip to content

Refactor ConfigMap and Secret resolvers and use controller.WithOnlyMetadata predicate #1545

Open
@ciarams87

Description

@ciarams87

Currently, we cache all the Secrets in the cluster., and ConfigMaps when the experimental Gateway API features are enabled, in NGF. This can lead to unnecessary memory consumption, as we only need to store any referenced resources. A better approach would be to use the controller.WithOnlyMetadata() predicate and then fetch the required resources when they are referenced.

Additionally, the secret and configmap resolvers are in the graph package, but we have a resolver package which would be more logical for them to reside. There's also an opportunity for the resolvers to be refactored to deduplicate functionality. Moving the resolvers to the resolver package also simplifies passing the k8s client to the resolvers, which is required when using the controller.WithOnlyMetadata predicate as the referenced resources need to be fetched from the API by the resolver.

AC:

  • Use controller.WithOnlyMetadata predicate for Secrets and ConfigMaps
  • Move the *resolvers to the resolver package
  • Refactor and dedupe the resolvers where necessary

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/performancePerformance relatedbacklogCurrently unprioritized work. May change with user feedback or as the product progresses.

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions