• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1TP1: xdstp:// structured resource naming, caching and federation support.
2----
3* Author(s): Harvey Tuch, Louis Ryan, Mark Roth, Costin Manolache, Matt Klein
4* Approver:
5* Implemented in: <xDS client, ...>
6* Last updated: 2021-08-21
7
8## Abstract
9
10This proposal describes a set of related changes to the [xDS transport
11protocol](https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol)
12aimed at supporting caching, federation, scalability and improved reliability of
13the xDS transport.
14
15These changes are motivated by the growth of the xDS ecosystem, including client
16diversity, range of deployments, layering of config/control pipelines and desire
17for hybrid control plane topologies in the xDS community.
18
19We introduce a new structured resource naming format based on Uniform Resource
20Identifiers (URIs) with the `xdstp://` scheme.  xDS resource names can now
21function as independent cache keys without requiring additional transport
22context. In addition, resource names support a notion of named authority,
23namespace delegation and failover.
24
25A distinction between resource singletons and collections is also included in
26the transport protocol. This formalizes some of the loose conventions that
27Envoy's use of xDS had established and allows for generalization for use cases
28such as [LEDS](https://github.com/envoyproxy/envoy/issues/10373).  These changes
29help to eliminate technical debt in the transport protocol, by removing special
30case treatment of LDS and CDS in xDS, deprecating resource name aliases and
31aligning the future of the transport protocol behind delta xDS.
32
33## Background
34
35Since the introduction of v2 xDS in Envoy, the transport protocol has provided a
36generic pub-sub mechanism between client (Envoy) and management server (xDS
37control plane). The resources have been opaque, identified by a type
38URL, opaque resource name string and opaque version string.
39
40For example, a route configuration resource named `foo` would have type URL
41`envoy.config.route.v3.RouteConfiguration` and a version string such as `42-a`.
42
43In addition, control planes have interpreted the
44[`Node`](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/base.proto#envoy-v3-api-msg-config-core-v3-node)
45message presented at the start of an xDS transport stream to provide further
46contextual information, for example node ID, locality, credentials, tenancy information,
47user agent, local environment configuration, etc. In general,
48arbitrary key-value metadata is expressible in the `Node` message.
49
50While the xDS resource naming scheme above identifies a single resource, special case
51provisions were needed for collections; LDS and CDS resource collections were treated in a
52distinguished manner by interpreting empty resources request sets as wildcards.
53
54An Aggregated Discovery Stream (ADS) was introduced to Envoy to support
55greater efficiency, server stickiness and better-than-eventual consistency for
56API updates. A single control plane server was assumed, since Envoy had
57mostly been used in direct client-server applications.
58
59While this has been sufficient for many use cases to date, a number of limitations
60have become evident which this proposal addresses. These are enumerated in the
61following sub-sections.
62
63### Caching & Scalability
64
65As the xDS and Envoy ecosystems have grown, so has the number of applications where xDS
66finds itself used. Some of these applications require caching of xDS resources,
67for example:
68
69*   Scalable control planes that deal with the problem of client fan-out. An
70    example of a project tackling this is
71    [xds-relay](https://github.com/envoyproxy/xds-relay).
72*   Hybrid on-premise/cloud clients and control planes. Resources might be
73    cached
74    on-premise to enhance reliability in the event of an interconnect outage.
75*   Mobile and edge, where an xDS client such as Envoy runs in mobile
76    applications with `O(millions+)` of xDS clients interacting with a control
77    plane. An example project in this space is [Envoy
78    Mobile](https://github.com/envoyproxy/envoy-mobile).
79
80In some cases, control planes have been observed as treating xDS resources as *mutable*. Depending on the
81contents of the `Node` message (which may change over the lifetime of an xDS
82transport stream), they can provide the same resource `foo` at a given version
83with different values.
84
85This impacts cacheability; the `Node` message becomes part of the cache key (and
86must be distributed across [xDS
87relays](https://docs.google.com/document/d/1X9fFzqBZzrSmx2d0NkmjDW2tc8ysbLQS9LaRQRxdJZU/edit?disco=AAAAGQ_84vU&ts=5e61532c&usp_dm=false)).
88This conflates client identity with resource identity. Some of the `Node`
89message is only relevant on a single hop to the management server, but in more
90complex topologies other attributes (e.g. metadata) are what really matter when
91trying to fetch a resource.
92
93The proposal below introduces *immutable* resource names which fully encapsulate
94resource context; an xDS resource name URI is a cache key, control planes are
95expected to provide resource [idempotence](https://restfulapi.net/idempotent-rest-apis/) for
96client resource fetches at a given resource version.
97
98### Federation
99
100xDS federation describes an xDS client that fetches resources from more than one
101management server. A single xDS client's configuration is disaggregated across
102multiple authorities. Other features of federation include delegation of
103authority between management servers, failover and support for hybrid topologies
104(e.g. on-premise/cloud, cloud A/B). Some example use cases:
105
106*   Failover from a Control Plane as-a-service (CPaaS) to an on-premise control
107    plane during a network partition.
108*   On-premise authoring and publication of xDS fragments to a CPaaS.
109*   Disaggregating responsibility for load balancing APIs between on-premise and
110    CPaaS. For example splitting the health check and load assignment
111    responsibilities.
112*   Disaggregating an xDS control plane internally. Complex xDS control planes
113    may benefit from having multiple independent xDS providers with limited
114    coupling.
115*   Bridging independent service meshes with independent control planes.
116
117While there are many challenges in xDS federation, including:
118
119* Trust management, e.g. resource signing.
120* Improving resource composition and granularity when splitting provenence.
121* Coordination over authority delegation between management servers.
122
123we do not aim to tackle all of these below, instead restricting the proposal to
124a structured naming scheme that will provide the basis for future solutions to
125the full set of federation concerns.
126
127We define a control plane serving a given xDS resource as an *authority*. The
128proposal below introduces indirection to avoid the existing xDS conflation between the
129naming of an authority and the configuration of fetches from the authority (a
130[`ConfigSource`](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/config_source.proto#envoy-v3-api-msg-config-core-v3-configsource)
131message). This conflation makes it challenging to use multiple authorities today
132and contributes to configuration size scalability problems when federating.
133The proposal includes the authority in the xDS resource name URI.
134
135### xDS transport protocol technical debt
136
137Since the xDS transport protocol has been historically co-developed with the
138Envoy implementation, this close coupling and evolution (vs. upfront design) has
139given rise to acknowledged technical debt relating to resource naming and typing.
140
141#### Flat representation
142
143Today, resource identifies are a hodge podge of resource name, `Node` message,
144authority from `ConfigSource`, type URL and version. When communicating between
145humans or systems that don’t work with proto3 messages, there is no standard
146format for concisely encoding this information.
147
148URIs provide a powerful standards compliant way of specifying this information.
149
150#### Collections
151
152Using terminology from [REST resource
153naming](https://restfulapi.net/resource-naming/), xDS supports both singleton
154and collection discovery. For xDS types such as RDS/EDS/SDS, singleton
155resource names are provided explicitly in the discovery request, and returned.
156For other xDS types, e.g. CDS/LDS, an implicit wildcard name is expressed
157via an empty request resource name set.
158
159The limitations of this approach for collections become apparent when you
160consider what might be needed to select a subset of listeners or clusters via
161LDS/CDS. Often `Node` metadata is used for this purpose, which conflates node
162identity with per-resource type naming semantics.  Reasons to subset the
163universe of resources for a given type include:
164
165* Differentiating inbound/outbound listeners in a service mesh topology.
166* Sharding tenant listeners between different nodes in a multi-tenant proxy
167  fleet.
168* Distinguishing based on node function in a service mesh (e.g. ingress/egress).
169
170Collection namespacing is also necessary for scalable endpoint support
171in [LEDS](https://github.com/envoyproxy/envoy/issues/10373).
172
173In the proposal below, we introduce an explicit notion of collections and
174namespaces, expressed through xDS resource name URIs.
175
176#### Per-resource type transport naming semantics
177
178While most xDS resource types permit opaque resource naming at the discretion of
179the control plane, some xDS resources, namely VHDS, have specific resource
180name structure. VHDS requires a specific form
181[form](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/vhds.html?highlight=vhds#virtual-host-resource-naming-convention)
182for referenced resources, `<route configuration name>/<host entry>`. This permits the management
183server to lookup a  missing virtual host with the host entry inside the
184specified `RouteConfiguration` resource name. In this scheme, the route
185configuration name is acting as a namespace for the virtual host name.
186
187It’s likely other resource types in the future will require some structure, e.g.
188[LEDS](https://github.com/envoyproxy/envoy/issues/10373).  Rather than living
189with an arbitrary mix of opaque and structured forms, the URI-based xDS resource
190naming scheme below provides a structured scheme that can serve the
191expression needs of resource types such as VHDS and LEDS.
192
193#### Aliasing
194
195VHDS introduced aliasing to the xDS transport, since the same virtual host
196resource may be known by multiple names, e.g. `routeConfigA/foo.com,
197routeConfigA/bar.com`. This mechanism is not widely used yet elsewhere in xDS
198and it is another example of mixing the transport and data model resource layers
199in xDS.
200
201We introduce a redirection mechanism below that allows a control plane to
202provide aliasing semantics without requiring explicit transport-level support
203for aliasing. When querying for either `routeConfigA/foo.com` or `routeConfigA/bar.com`, the
204management server might issue a redirect causing the xDS client to fetch
205`someCanonicalVirtualHost` resource.
206
207This same mechanism is also useful when supporting resource delegation during
208federation and removes special case treatment of aliasing from the xDS transport
209protocol.
210
211### Related Proposals:
212
213* The original Google Docs design documents:
214  [Full](https://docs.google.com/document/d/1zZav-IYxMO0mP2A7y5XHBa9v0eXyirw1CxrLLSUqWR8/edit#heading=h.w8hw2zbv3jwl)
215  [Summary](https://docs.google.com/document/d/1m5_Q9LUlzvDdImP0jqh1lSTrLMldsApTQX6ibbd3i7c/edit?ts=5ec2fd8a#heading=h.w8hw2zbv3jwl)
216* [xDS transport protocol.](https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol)
217
218## Proposal
219
220The proposal below is fully backwards compatible with the existing xDS transport
221protocol and does not require any changes to clients or servers that do not wish
222to opt into the new naming scheme.
223
224### URI-based xDS resource names
225
226xDS URIs follow a [RFC-3986](https://tools.ietf.org/html/rfc3986) compliant
227schema. The following schema is proposed for xDS resource names:
228
229`xdstp://[{authority}]/{resource type}/{id/*}?{context parameters}{#processing directive,*}`
230
231* `authority` is an opaque string naming a resource authority, e.g.
232  `some.control.plane`.
233* `resource type` is the xDS resource type URL, e.g. `envoy.config.route.v3.RouteConfiguration`
234* `id/*` is the remaining path component of the URI and is fully opaque; naming
235  is at the discretion of the control plane(s).
236* `context parameters` are the URI query parameters and express contextual
237  information for selecting resource variants, for example `shard_id=1234&direction=inbound`.
238* A `processing directive` provides additional information to the client on how
239  the URI is to be interpreted. Two supported directives are:
240  * `alt=<xdstp:// URI>` expressing a fallback URI.
241  * `entry=<resource name>` providing an anchor referring to an inlined resource
242    for [list collections](#list). Resource names must be of the form `[a-zA-Z0-9_-\./]+`.
243
244Multiple directives are comma separated in the fragment component of the URI.
245The same directive may not appear more than once in a given URI.
246
247An example application of the above URI scheme is:
248
249`xdstp://some.control.plane/envoy.config.route.v3.RouteConfiguration/foo/bar?shard_id=1234&direction=inbound`
250
251We distinguish between two forms of `xdstp://` URIs:
252
253* Uniform Resource Locators (URLs) instructing a client on how to locate a given
254  xDS resource. URLs may include processing directives and [globs](#glob).
255
256* Uniform Resource Names (URNs) referring to a specific xDS resource. URNs do
257  not include processing directives or [globs](#glob). `xdstp://` URNs provide
258  self-contained cache keys.
259
260#### Proto3 expression
261
262`xdstp://` URIs are canonically encoded in `proto3` messages. The structure
263for this encoding is provided at https://github.com/cncf/xds/tree/main/xds/core/v3:
264
265* [URL](https://github.com/cncf/xds/blob/main/xds/core/v3/resource_locator.proto) definition
266* [URN](https://github.com/cncf/xds/blob/main/xds/core/v3/resource_name.proto) definition
267
268#### Normalization
269
270Two `xdstp://` URNs are considered equivalent if they match component-wise
271modulo context parameter ordering.
272
273#### Context parameters
274
275Context parameters in URNs presented by the client to the server will be
276composed from the following sources. Using an example of a URL
277`xdstp://some-authority/some.type/foo?bar=baz`:
278
279* Context parameters from the URL, in the above example
280  `bar=baz`. These must not be in the `xds.*` namespace.
281
282* Per-resource type well-known attributes, e.g. an on-demand listener load might
283  have `{xds.resource.vip: 96.54.3.1}`. These attributes are generated by code,
284  e.g. an on-demand LDS implementation will first detect the VIP, halt the
285  request, ask for the `xds.resource.vip` from the control plane, and then
286  resume the request after discovery is completed. All these attributes will be
287  `xds.resource.` prefixed.
288
289An example computed URN following the above example is
290`xdstp://some-authority/some.type/foo?bar=baz&xds.resource.vip=96.54.3.1`.
291
292This proposal reserves all prefixes beginning with a non-alphanumeric character
293for context parameter values in future URI context parameter enhancements.
294
295### Collections
296
297Two forms of resources collections are described below, *list* and *glob*. These
298different forms reflect the tension between the need for explicit collection
299representation (motivating list collections) and scalability concerns as this
300explicit representation becomes a bottleneck (motivating [glob](#glob) collections).
301
302Collections are typically used for LDS, CDS and (planned) LEDS. However, this
303list is not exhaustive and future xDS collection types may be added with no
304change to the transport protocol.
305
306#### List
307
308List collections provide a collection directory as a first-class xDS resource.
309For a given xDS resource type `<T>` the list collection type is named by
310convention as `<T>Collection` and defined as:
311
312```
313message <T>Collection {
314  repeated CollectionEntry resources = 1;
315}
316```
317
318where `CollectionEntry` is defined:
319
320
321```
322message CollectionEntry {
323  // Inlined resource entry.
324  message InlineEntry {
325    // Optional name to describe the inlined resource. Resource names must
326    // [a-zA-Z0-9_-\./]+. This name allows reference via the #entry directive
327    // in ResourceLocator. When non-empty, this name must be unique in any give
328    // list collection.
329    string name = 1 [(validate.rules).string.pattern = "^[0-9a-zA-Z_\\-\\.~:]+$"];
330
331    // The resource's logical version. It is illegal to have the same named xDS
332    // resource name at a given version with different resource payloads.
333    string version = 2;
334
335    // The resource payload, including type URL.
336    google.protobuf.Any resource = 3;
337  }
338
339  oneof resource_specifier {
340    option (validate.required) = true;
341
342    // A xdstp:// URL describing how the member resource is to be located.
343    string locator = 1;
344
345    // The resource is inlined in the list collection.
346    InlineEntry inline_entry = 2;
347  }
348}
349```
350
351A simple example of a listener collection fetch sequence:
352
3531. Client requests `xdstp://some-authority/envoy.config.listener.v3.ListenerCollection/foo.`
3542. Server responds with a list of resources: `[locator:
355   xdstp://some-authority/envoy.config.listener.v3.Listener/bar, locator:
356   xdstp://some-authority/envoy.config.listener.v3.Listener/baz].`
3573. Client requests both
358   `xdstp://some-authority/envoy.config.listener.v3.Listener/bar `and
359   `xdstp://some-authority/envoy.config.listener.v3.Listener/baz.`
3604. Server responds with resources contents for
361   `xdstp://some-authority/envoy.config.listener.v3.Listener/bar `and
362   `xdstp://some-authority/envoy.config.listener.v3.Listener/baz`.
363
364This involves two round-trips. Inlining of resources is supported, which can reduce RTT, i.e.
365
3661. Client requests `xdstp://some-authority/envoy.config.listener.v3.ListenerCollection/foo.`
3672. Server responds with a collection of literal resources inlined in `foo`:
368   `[inline_entry: xdstp://some-authority/envoy.config.listener.v3.Listener/bar,
369   inline_entry: xdstp://some-authority/envoy.config.listener.v3.Listener/baz].`
370
371Note that in all cases, the context parameters presented in the original request
372must be present in the response. For example, a request for
373`xdstp://some-authority/envoy.config.listener.v3.ListenerCollection/foo?some=thing`, must
374be responded to with a resource named
375`xdstp://some-authority/envoy.config.listener.v3.ListenerCollection/foo?some=thing`.
376However, individual resources referenced by locator inside the returned list
377collection do not need to have the collection-level context parameters included
378in their naming.
379
380#### Glob
381
382Having explicit collection resources allows delta xDS to provide delta updates
383on individual resources but the resource list itself can become a bottleneck for
384frequently updated large collections of resources, e.g. with 1M endpoints updating
385every 10s.  For this situation, we introduce *glob
386collections*, which allow the `<T>Collection` directory to be elided when
387resources in a collection share a directory structure and a `/*` component is appended to
388the resource path. Continuing the previous example, this now looks like:
389
3901. Client requests
391   `xdstp://some-authority/envoy.config.listener.v3.Listener/foo/*`.
3922. Server responds with resources
393   [`xdstp://some-authority/envoy.config.listener.v3.Listener/foo/bar,
394   xdstp://some-authority/envoy.config.listener.v3.Listener/foo/baz]`.
395
396Note that there is no explicit directory sent enumerating `{bar, baz}`. Rather,
397glob collections provide delta updates directly on directory resources.
398
399Globs can exist in arbitrary path locations, e.g.
400`xdstp://some-authority/envoy.config.listener.v3.Listener/some/longer/path/*`.
401Multiple globs may be subscribed to in a `DeltaDiscoveryRequest`.
402
403Since each resource returned is subject to independent update via delta xDS and
404there is no explicit collection directory to update, glob collections are highly
405scalable. For example, consider a collection of 10k resources and the addition
406of a single resource. Glob collections will send the single additional resource
407(due to the operation of delta xDS). List collections requires that the
408collection directory (now containing 10001 resource references) to be sent from
409server to client, as well as the additional new resource.
410
411If no resources are present in the glob collection, the server should reply with a
412`DeltaDiscoveryResponse` in which the glob collection URL is specified in
413`removed_resources`.
414
415As with list collections, context parameters in the request must be matched in
416responses. A request for
417`xdstp://some-authority/envoy.config.listener.v3.Listener/foo/*?some=thing` will
418match a resource
419`xdstp://some-authority/envoy.config.listener.v3.Listener/foo/bar?some=thing`
420but not `xdstp://some-authority/envoy.config.listener.v3.Listener/foo/bar`.
421
422#### Use cases
423
424This proposal provides multiple collection mechanisms, as there is a need to
425tradeoff ergonomics (i.e. being able to reason about a collection via single
426object), performance (i.e. number of round trips) and scalability (e.e. avoiding
427a collection directory becoming a bottleneck).
428
429Some suggested use patterns for the collections are as follows:
430
431*   Federated collections (list collections with references)
432*   HTTP CDN delivery of configuration (list collections with references)
433*   Handcrafted configuration on a filesystem (list collections with inline entries)
434*   Migration of an existing state-of-the-world (SotW) Envoy configuration (list collections with inline entries)
435*   LEDS and high scalability delta APIs (glob collections)
436
437For any other use case with a:
438
439*   Small collection of objects or relatively static configuration;
440    list collections with inline entries are recommended. This is both
441    performant and requires minimal management server state tracking and round
442    trips.
443*   Medium sized collection of objects; list collections with reference entries.
444    The management server only needs to handle subscribe/unsubscribe state
445    tracking, since both the collection and its constituent resources are
446    independent xDS resources.
447*   For any other use case with a large collection of objects and/or highly
448    dynamic updates, glob collections are recommended. The management server needs to
449    provide full delta diffs, since there is no explicit collection object to
450    inform the client when resources come and go.
451
452### Transport network addressing
453
454An `xdstp://` URI specifies a logic authority and it’s necessary to map to some physical
455network address during the resource fetch process. In the existing xDS configuration
456fetch configuration, this capability is provided by a `ConfigSource` delivered alongside a
457resource name in the xDS resource graph.
458
459This proposal adds to `ConfigSource` the ability to specify the
460authorities for which the `ConfigSource` may be used:
461
462```
463message Authority {
464  string name = 1;
465
466  … when signing is added, items such as CA trust chain, cert pinning …
467}
468
469message ConfigSource {
470  repeated Authority authorities = N;
471
472  …  extant ConfigSource …
473}
474```
475
476When the `ConfigSource` adjacent to a resource name matches the URI authority,
477the `ConfigSource` will continue to be used.
478
479When there is no match, the xDS client will fallback to the bootstrap to map
480from authority to `ConfigSource`. The bootstrap format is client specific, an
481example of this is:
482
483```
484// List of authorities and config.
485repeated ConfigSource xdstp_config_sources = N;
486
487```
488
489A client may support only static bootstrap configuration of `ConfigSource` for authority mapping. It is
490expected that relevant authorities are configured in the bootstrap for referenceable servers.
491
492To support ADS with multiple control planes, the
493[`ApiType`](https://github.com/envoyproxy/envoy/blob/31128e7dc22355876020188bc8feb99304663041/api/envoy/config/core/v3/config_source.proto#L44)
494enum in `ApiConfigSource` will be augmented with `AGGREGATED_DELTA_GRPC`.
495This will replace and deprecate the existing `ads` field in `ConfigSource`. When
496used in `xdstp://` authority resolution, an `ConfigSource` will act as an ADS
497transport if configured with this new enum value. Instead of pointing to a
498single shared ADS `ConfigSource` declared in the bootstrap, any resource
499authority (regardless of type) that maps to a `ConfigSource` with
500`AGGREGATED_DELTA_GRPC` will be multiplexed on the xDS stream specified by the
501`ConfigSource`.
502
503### Discovery request and responses
504
505Clients are expected to have knowledge ahead of time (via mechanisms not part of
506this proposal, e.g. support documentation) on whether the servers specified in
507the bootstrap supports the new URI conventions.
508
509Examples below are provided for delta xDS, but this proposal does not limit
510usage to delta xDS. We directionally intend for delta xDS to supplant SotW xDS
511over time, the use of inlined entries in list collections allows simple
512management servers that do not wish to perform state tracking to perform
513state-of-the-world updates. This is achieved by sending the entire state, e.g.
514every listener inlined in a `ListenerCollection`. However, migration is
515expected to be slow on the uptake and continued SotW support is provided for
516this proposal.
517
518### Server redirects
519
520The server may issue redirects by including the following message
521in a `Resource` wrapped in the `Any` message:
522
523```
524message ResourceLocator {
525  string resource_locator = 1;
526}
527```
528
529Redirects are only supported for
530list collections. Glob collections may have individual resources redirected but the
531collection itself is not redirectable.
532
533### Examples
534
535We provide YAML examples below of discovery request/response sequences for various use cases.
536
537#### Singleton resource request
538
539Client `Cluster` resource:
540
541
542```
543name: some-cluster
544eds_cluster_config:
545  service_name: xdstp://some-authority/envoy.config.endpoint.v3.ClusterLoadAssignment/foo
546  eds_config:
547    authorities:
548    - name: some-authority
549  … rest of ConfigSource pointing at xDS management server …
550```
551
552Client EDS `DeltaDiscoveryRequest` sent to xDS management server:
553
554
555```
556resource_names_subscribe:
557- xdstp://some-authority/envoy.config.endpoint.v3.ClusterLoadAssignment/foo
558```
559
560
561xDS management server `DeltaDiscoveryResponse` sent to client:
562
563
564```
565resources:
566- version: 1
567  name: xdstp://some-authority/envoy.config.endpoint.v3.ClusterLoadAssignment/foo
568  resource:
569    "@type": type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
570    … foo's ClusterLoadAssignment payload …
571```
572
573#### Collection resource requests
574
575##### List collections
576
577Client bootstrap:
578
579
580```
581dynamic_resources:
582  lds_resources_locator:
583    name: xdstp://some-authority/envoy.config.listeners.v3.ListenerCollection/foo
584  lds_config:
585    authorities:
586    - name: some-authority
587  … rest of ConfigSource pointing at xDS management server …
588```
589
590
591Client LDS `DeltaDiscoveryRequest` sent to xDS management server:
592
593
594```
595resource_names_subscribe:
596- xdstp://some-authority/envoy.config.listeners.v3.ListenerCollection/foo
597```
598
599
600xDS management server `DeltaDiscoveryResponse` sent to client:
601
602
603```
604resources:
605- version: 1
606  name: xdstp://some-authority/envoy.config.listeners.v3.ListenerCollection/foo
607  resource:
608    "@type": type.googleapis.com/envoy.config.listeners.v3.ListenerCollection
609    - locator: xdstp://some-authority/envoy.config.listeners.v3.Listener/bar
610    - locator: xdstp://some-authority/envoy.config.listeners.v3.Listener/baz
611```
612
613
614The `bar` and `baz` resources are then fetched as per [singleton resource
615requests](#singleton-resource-request).
616
617##### List collections with inlining
618
619As with the previous list collection example, but rather than returning a list
620of URLs in the response, the xDS management server sends to the
621client the following `DeltaDiscoveryResponse`:
622
623
624```
625resources:
626- version: 1
627  name: xdstp://some-authority/envoy.config.listeners.v3.ListenerCollection/foo
628  resource:
629    "@type": type.googleapis.com/envoy.config.listeners.v3.ListenerCollection
630    - inline_entry:
631        name: bar
632        version: 8.5.4
633        resource:
634          "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
635          … bar's ClusterLoadAssignment payload …
636    - inline_entry:
637        # anonymous resource
638        version: 3.9.0
639        resource:
640          "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
641          … baz's ClusterLoadAssignment payload …
642```
643
644
645Note that the first resource bar can be referenced in a URI as
646`xdstp://some-authority/envoy.config.listeners.v3.ListenerCollection/foo#entry=bar`,
647while the second resource is anonymous and cannot be referenced outside the
648collection.
649
650Inlining may be used at the discretion of the management server as a transport
651optimization (fewer round-trips).
652
653##### Glob collections
654
655Client bootstrap:
656
657
658```
659dynamic_resources:
660  lds_resources_locator:
661    name: xdstp://some-authority/envoy.config.listeners.v3.Listener/my-listeners/*?node_type=ingress
662  lds_config:
663    authorities:
664    - name: some-authority
665  … rest of ConfigSource pointing at xDS management server …
666```
667
668
669Client LDS `DeltaDiscoveryRequest` sent to xDS relay proxy (note the use of client capabilities):
670
671
672```
673resource_names_subscribe:
674- xdstp://some-authority/envoy.config.listeners.v3.Listener/my-listeners/*?node_type=ingress
675```
676
677xDS management server `DeltaDiscoveryResponse` sent to the client:
678
679
680```
681resources:
682- version: 1
683  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/my-listeners/foo?node_type=ingress
684  resource:
685    "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
686    … foo's Listener payload …
687- version: 42
688  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/my-listeners/bar?node_type=ingress
689  resource:
690    "@type": type.googleapis.com/xds.core.v3.ResourceLocator
691    <xdstp://some-authority/envoy.config.listeners.v3.Listener/baz>
692```
693
694
695In this example,
696`xdstp://some-authority/envoy.config.listeners.v3.Listener/my-listeners/bar` was
697redirected to `xdstp://some-authority/envoy.config.listeners.v3.Listener/baz.` The
698context parameters (ingress, client caps) were used to filter down the listener
699set for the client in a given collection (`my-listeners`).
700
701#### Alternatives
702
703In this example, a CPaaS wants to specify on-premise control plane resources as
704failovers on network partition.
705
706The CPaaS management server `DeltaDiscoveryResponse` sends to the client inside a `Cluster` resource:
707
708```
709name: some-cluster
710type: EDS
711eds_cluster_config:
712  service_name: xdstp://some-cloud-authority/envoy.config.endpoint.v3.ClusterLoadAssignment/foo#alt=xdstp://some-onprem-authority/envoy.config.endpoint.v3.ClusterLoadAssignment/bar
713  eds_config:
714    authorities:
715    - name: some-cloud-authority
716  … rest of ConfigSource pointing at xDS management server …
717```
718
719The client has a `ConfigSource for `some-onprem-authority` specified in its
720bootstrap.
721
722Client EDS `DeltaDiscoveryRequest` sends to xDS management server for `some-cloud-authority`:
723
724
725```
726resource_names_subscribe:
727- xdstp://some-cloud-authority/envoy.config.endpoint.v3.ClusterLoadAssignment/foo
728```
729
730Under normal conditions, the requested resource is returned as above. If the
731config source for `some-cloud-authority` is unreachable, then the client issues
732a new `DeltaDiscoveryRequest` to `some-onprem-authority`:
733
734
735```
736resource_names_subscribe:
737- xdstp://some-onprem-authority/envoy.config.endpoint.v3.ClusterLoadAssignment/bar
738```
739
740We defer to future xRFCs details on how failover, retry and recover occur.
741
742#### xDS relay proxy
743
744In this example, two clients work with an xDS relay proxy to receive their
745configuration from some canonical xDS server.
746
747Client A bootstrap:
748
749
750```
751dynamic_resources:
752  lds_resources_locator:
753    name: xdstp://some-authority/envoy.config.listeners.v3.Listener/a-listeners/*
754  lds_config:
755    authorities:
756    - name: some-authority
757  … rest of ConfigSource pointing at xDS relay proxy …
758```
759
760
761Client A LDS `DeltaDiscoveryRequest` sent to xDS relay proxy:
762
763
764```
765resource_names_subscribe:
766- xdstp://some-authority/envoy.config.listeners.v3.Listener/a-listeners/*
767```
768
769Client B bootstrap:
770
771
772```
773dynamic_resources:
774  lds_resources_locator:
775    name: xdstp://some-authority/envoy.config.listeners.v3.Listener/b-listeners/*
776  lds_config:
777    authorities:
778    - mame: some-authority
779  … rest of ConfigSource pointing at xDS relay proxy …
780```
781
782Client B LDS `DiscoveryRequest` sent to xDS relay proxy:
783
784
785```
786resource_names_subscribe:
787- xdstp://some-authority/envoy.config.listeners.v3.Listener/b-listeners/*
788```
789
790
791xDS relay proxy `DeltaDiscoveryRequest` sent to some `some-authority`:
792
793
794```
795resources_names_subscribe:
796- xdstp://some-authority/envoy.config.listeners.v3.Listener/a-listeners/*
797- xdstp://some-authority/envoy.config.listeners.v3.Listener/b-listeners/*
798```
799
800
801The origin for `some-authority` replies with a `DeltaDiscoveryResponse` sent to
802xDS relay proxy:
803
804
805```
806resources:
807- version: 1
808  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/a-listeners/foo
809  resource:
810    "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
811    … foo's Listener payload …
812- version: 42
813  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/a-listeners/bar
814  resource:
815    "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
816    … bar's Listener payload …
817- version: 13
818  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/b-listeners/baz
819  resource:
820    "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
821    … baz's Listener payload …
822```
823
824xDS relay proxy `DeltaDiscoveryResponse` sent to client A:
825
826```
827resources:
828- version: 1
829  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/a-listeners/foo
830  resource:
831    "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
832    … foo's Listener payload …
833- version: 42
834  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/a-listeners/bar
835  resource:
836    "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
837    … bar's Listener payload …
838```
839
840xDS relay proxy `DeltaDiscoveryResponse` sent to client B:
841
842```
843resources:
844- version: 13
845  name: xdstp://some-authority/envoy.config.listeners.v3.Listener/b-listeners/baz
846  resource:
847    "@type": type.googleapis.com/envoy.config.listeners.v3.Listener
848    … baz's Listener payload …
849```
850
851## Rationale
852
853N/A
854
855
856## Implementation
857
858N/A
859