Description
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
Labels
Type
Projects
Status