-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Delta CDS: add on-demand cds support #9626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bf560ca
1452bec
acdbeaa
5342488
0df0b7b
f0b4c76
05ba93a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,40 @@ Statistics | |
| ---------- | ||
|
|
||
| CDS has a :ref:`statistics <subscription_statistics>` tree rooted at *cluster_manager.cds.* | ||
|
|
||
| On-demand CDS | ||
| ------------- | ||
|
|
||
| Similar to VHDS on-demand feature in terms of hosts, the on-demand CDS API is an additional API | ||
| that Envoy will call to dynamically fetch upstream clusters which Envoy interested in spontaneously. | ||
|
|
||
| By default in CDS, all cluster configurations are sent to every Envoy instance in the mesh. The | ||
| delta CDS provides the ability that the xDS management server can send incremental CDS to the Envoy | ||
| instance, but Envoy instance can not feedback upstream clusters it interested in spontaneously, in | ||
| other words, Envoy instance only can receive the CDS passively. | ||
|
|
||
| In order to fix this issue, on-demand CDS uses the delta xDS protocol to allow a cluster configuration | ||
| to be subscribed to and the necessary cluster configuration to be requested as needed. Instead | ||
| of sending all cluster configuration or cluster configuration the Envoy instance aren't interested | ||
| in, using on-demand CDS will allow an Envoy instance to subscribe and unsubscribe from a list of | ||
| cluster configurations stored internally in the xDS management server. The xDS management server | ||
| will monitor the list and use it to filter the configuration sent to an individual Envoy instance | ||
| to only contain the subscribed cluster configurations. | ||
|
||
|
|
||
| Subscribing to resources | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| On-demand CDS allows resources to be :ref:`subscribed <xds_protocol_delta_subscribe>` to using | ||
| a :ref:`DeltaDiscoveryRequest <envoy_api_msg_DeltaDiscoveryRequest>` | ||
| with the :ref:`type_url <envoy_api_field_DeltaDiscoveryRequest.type_url>` set to | ||
| `type.googleapis.com/envoy.api.v2.Cluster` and | ||
| :ref:`resource_names_subscribe <envoy_api_field_DeltaDiscoveryRequest.resource_names_subscribe>` | ||
| set to a list of cluster resource names for which it would like configuration. | ||
|
||
|
|
||
| Typical use case | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| Sometimes, there will be a large amount of broker instances provided for | ||
| `Apache RocketMQ <http://rocketmq.apache.org/>`_ to produce/consume messages. Perhaps the size of | ||
| SToW CDS configurations will be more than 1GB, so it is not practical to deliver the SToW CDS from the | ||
| management server every time, which will cause huge overhead. In this case, on-demand CDS is essential. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -227,6 +227,8 @@ class ClusterManager { | |
| * @return Config::SubscriptionFactory& the subscription factory. | ||
| */ | ||
| virtual Config::SubscriptionFactory& subscriptionFactory() PURE; | ||
|
|
||
| virtual void addToClusterInterest(const std::set<std::string>& add_these_names) PURE; | ||
|
||
| }; | ||
|
|
||
| using ClusterManagerPtr = std::unique_ptr<ClusterManager>; | ||
|
|
@@ -253,6 +255,11 @@ class CdsApi { | |
| * @return std::string last accepted version from fetch. | ||
| */ | ||
| virtual const std::string versionInfo() const PURE; | ||
|
|
||
| /** | ||
| * Add watch set of cluster resources interested. | ||
| */ | ||
| virtual void addToClusterInterest(const std::set<std::string>& add_these_names) PURE; | ||
| }; | ||
|
|
||
| using CdsApiPtr = std::unique_ptr<CdsApi>; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markdroth FYI, in case you have some review bandwidth cycles to give this a pass similar to the VHDS one.