Multi-cluster service with native service access
In Karmada, the MultiClusterService can enable users to access services across clusters with the native service domain name, like foo.svc, with the aim of providing users with a seamless experience when accessing services across multiple clusters, as if they were operating within a single cluster.

Once the network is connected between clusters, with MultiClusterService, the accessing will be directed to the active backend pods distributed across these clusters.
The MultiCluster Service is implemented as a Karmada API resource and multiple controllers, the resource determines the behavior of the controller. The multiple controllers, running within the Karmada control plane, sync the services' backend EndpointSlice resource between clusters, to add the multiple clusters' pods' IP to the services' backend.
How does a MultiCluster Service work?
To implement access service across multiple clusters with native service name, Karmada introduces multiple controllers to sync the services' backend EndpointSlice resource between clusters, they work as follows:

- Karmada will collect EndpointSlice resources from all target clusters, and sync them to the Karmada control plane.
- Karmada will sync the collected EndpointSlice resources to all target clusters, with attaching the EndpointSlice to the service.
- When users access through
foo.svc, the underlying network will route the request to the backend pods in the multiple clusters.
API Object
The MultiClusterService is an API in the Karmada networking API group. The current version is v1alpha1.
You can check the MultiClusterService API specification here.
限制
当成员集群处于未就绪状态时(例如 Karmada 控制面无法访问该集群的 kube-apiserver),Karmada 不会删除该集群的 MultiClusterService 或 EndpointSlice 资源,从而避免服务中断(多数情况下集群内 Pod 仍在运行并对外提供服务)。因此,当集群未就绪且该集群内后端 Pod 实际已无法提供服务时,多集群服务发现可能会失败。此时您可以修改或删除 MultiClusterService 资源,不再使用目标集群上的服务即可。
What's next
If you configure MultiClusterService, you may also want to consider how to connect the network between clusters, such as Submariner.
For more information on MultiClusterService:
- Read Access service across clusters within native service name to know how to use MultiClusterService.