8000 [feat]: Introduce multi-cluster and multi-registry architecture by stringl1l1l1l · Pull Request #795 · apache/dubbo-kubernetes · GitHub
[go: up one dir, main page]

Skip to content

Conversation

stringl1l1l1l
Copy link
@stringl1l1l1l stringl1l1l1l commented Sep 29, 2025

This PR introduces a foundational architectural overhaul of the service discovery system, transforming it into a highly extensible, unified platform. It adds comprehensive support for multi-cluster management, integrates multiple new service registry providers including Nacos, Zookeeper, and Istio, and introduces a cloud-native Kubernetes annotation-based discovery mechanism.

Major Changes

1. Multi-Cluster Management System

  • New Cluster Manager (pkg/cluster): A dedicated, thread-safe manager has been introduced to handle the lifecycle of multiple Kubernetes clusters. It is responsible for adding, removing, retrieving, and performing periodic health checks on each configured cluster, ensuring high availability and resilience.
  • Declarative Configuration: Cluster connections are now managed through a new configuration file (multi-cluster.yaml) and corresponding command-line flags, allowing operators to define cluster endpoints, credentials, and metadata like region and priority.

2. Pluggable Multi-Registry Framework

  • Nacos & Zookeeper Support: The service discovery mechanism has been extended to include native support for Nacos (sail/pkg/serviceregistry/nacos) and Zookeeper (sail/pkg/serviceregistry/zookeeper) as first-class service registry providers.
  • Unified Configuration: A multi-registry.yaml configuration file and new CLI flags allow for declaratively defining connections to various registries, each with its own ID, priority, and type-specific parameters.

3. Istio Service Mesh Integration

  • Istio as a Service Registry (sail/pkg/serviceregistry/istio): A complete integration with Istio has been implemented, allowing the system to use the Istio service mesh as a source of truth for service discovery.
  • Pilot xDS Client: A new gRPC client connects directly to Istio's Pilot (istiod) to watch for service changes, leveraging the power of the mesh for discovery.
  • Service Model Conversion: A dedicated converter translates service information from Istio's internal representation (including VirtualService and DestinationRule metadata) into Dubbo's unified service model.
  • Configuration & Examples: The integration is configurable via new CLI flags and is demonstrated in the new istio-service-registry.yaml example.

4. Kubernetes-Native Service Discovery

  • Annotation-Based Discovery: A new mechanism has been added to discover Dubbo services directly from standard Kubernetes Service objects by parsing dubbo.apache.org/* annotations. This provides a more cloud-native and declarative way to register services.
  • New Annotation Parser (sail/pkg/serviceregistry/kube/annotations): A dedicated, robust parser has been created to validate and extract Dubbo service metadata (service name, version, group, etc.) from Kubernetes Service annotations.

5. Enhanced Registry Aggregator & Core Systems

  • Resilient Controller Lifecycle: The core aggregate controller (aggregate.Controller) has been significantly improved with better panic recovery for individual registry controllers, ensuring a single failing registry does not impact the entire system.
  • Advanced Service Merging: The service merging logic now intelligently handles different provider types (Kubernetes, KubernetesNative, Istio, etc.) with distinct strategies and prefixes labels to prevent collisions.
  • Expanded Configuration: The bootstrap options (options.go), CLI flags, and Helm chart (values.yaml) have been extensively updated to support the configuration of all new features.
  • Extended Data Model: The core Service model has been enriched to carry metadata from Kubernetes and Istio resources.

Key Features Added

  1. Multi-Cluster Support: Manage and discover services across multiple, geographically distributed Kubernetes clusters from a single control plane.
  2. Expanded Registry Integration: Natively connect to Nacos, Zookeeper, and Istio registries in addition to Kubernetes.
  3. Istio-Native Discovery: Leverage an existing Istio service mesh as a powerful and reliable service registry.
  4. Annotation-based K8s Discovery: Discover Dubbo services in a cloud-native way using standard Kubernetes Service objects, simplifying deployment.
  5. Unified & Resilient Service Aggregation: A robust, unified view of all services across all connected sources with improved fault tolerance.

Breaking Changes

  • This PR introduces a new, more powerful configuration model based on YAML files (multi-cluster.yaml, multi-registry.yaml) and a significant number of new CLI flags. While backward compatibility for basic setups may be maintained, it is highly recommended to adopt the new configuration model to leverage the full capabilities of the new architecture.

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Docs
  • Installation
  • User Experience
  • Dubboctl
  • Console
  • Core Component

- Add comprehensive Istio service mesh integration for service discovery
- Implement Istio service registry controller with xDS protocol support
- Add gRPC client for Istio Pilot communication and service watching
- Extend service model with Istio-specific fields (VirtualService, DestinationRule)
- Support service conversion between Istio and Dubbo formats
- Add configuration management with TLS support
- Integrate Istio provider into aggregated service registry
- Include command-line flags for Istio configuration
- Add comprehensive test coverage and documentation
- Provide Kubernetes deployment examples and usage guides
@stringl1l1l1l stringl1l1l1l force-pushed the ospp-2025-feat-multicluster branch from 5619f46 to cadf0cb Compare September 29, 2025 14:56
@stringl1l1l1l stringl1l1l1l marked this pull request as ready for review September 29, 2025 15:06
@stringl1l1l1l stringl1l1l1l force-pushed the ospp-2025-feat-multicluster branch from cadf0cb to 23b5709 Compare September 29, 2025 15:58
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
0