Global Search for Resources
Background
Multicluster is becoming a common practice. It brings services closer to users.
But it also makes it hard to query Kubernetes resources across clusters.
Therefore, we need a caching layer and a search engine for Karmada to cache and search for Kubernetes resources across multiple clusters.
We introduced a new component named karmada-search and a new API group called search.karmada.io to implement it.
What karmada-search can do

karmada-search can:
- Accelerate resource requests processing across regions.
- Provide a cross-cluster resource view.
- Be compatible with multiple Kubernetes resource versions.
- Unify resource requests entries.
- Reduce API server pressure on member clusters.
- Adapt to a variety of search engines and databases.
What's more, karmada-search also supports proxying one global resource. See here for details.
note
- This feature aims to build a cache to store arbitrary resources from multiple member clusters. And these resources are exposed by
search/proxyREST APIs. If a user has access privilege tosearch/proxy, they can directly access the cached resource without routing their request to the member clusters. - As previously mentioned, the resource query request will not be routed to the member clusters. So if a secret is cached in the Karmada control plane but a user in the member cluster cannot access it via member cluster's apiserver due to RBAC privilege limitations, they can still access the secret through the Karmada control plane.
- This feature is designed for administrators who needs to query and view the resources in multiple clusters, not designed for the end users. Exposing this API to the end users may cause end users to be able to view resources that do not belong to them.
Scope the caching
.spec in ResourceRegistry defines the cache scope.
It has three fields to set:
- TargetCluster
- ResourceSelector
- BackendStore