Skip to content

feat: multi cluster resource management and cache efficiency#4

Merged
zachsmith1 merged 6 commits intomainfrom
fix/mc-namespace-lifecycle
Jan 27, 2026
Merged

feat: multi cluster resource management and cache efficiency#4
zachsmith1 merged 6 commits intomainfrom
fix/mc-namespace-lifecycle

Conversation

@zachsmith1
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to multicluster admission handling and configuration, focusing on cluster-aware resource management, cache efficiency, and code maintainability. The most significant changes include switching cluster identification from annotations to labels, adding efficient client/informer pools for per-cluster operations, introducing a CEL runtime cache for webhook admission, and ensuring proper decoration of REST options for multicluster routing.

Cluster-aware resource handling and configuration:

  • Cluster identification is now managed via labels instead of annotations in both mutating and validating admission plugins, ensuring consistency and better alignment with Kubernetes conventions.
  • Per-cluster client and informer pools are introduced and wired through the configuration and namespace manager, enabling efficient reuse and sharing of cluster resources for admission and lifecycle plugins.

Multicluster REST options decoration:

  • A new decorateRESTOptionsGetter helper ensures that REST options getters are properly decorated for multicluster routing across controlplane, apiextensions, and aggregator servers, with logging for decoration status.

Webhook admission improvements:

  • A new CEL runtime cache (CelRuntime) is implemented for webhook admission, providing efficient, per-cluster and per-resource CEL environment compilation and metrics for cache hits/builds. Associated unit tests verify caching behavior.

Namespace lifecycle and plugin enhancements:

  • The namespace lifecycle plugin now avoids deadlocks on initial cache sync by setting a ready function that always returns true, improving reliability during cluster initialization.

@zachsmith1 zachsmith1 merged commit 6363d75 into main Jan 27, 2026
1 check passed
@zachsmith1 zachsmith1 deleted the fix/mc-namespace-lifecycle branch March 3, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant