Commit Graph

17 Commits

Author SHA1 Message Date
Easwar Swaminathan 06c094c3ab
xds/client: Process security configuration from Cluster resource (#3931) 2020-10-08 15:50:51 -07:00
Menghan Li 0dc9986169
lrs: add a layer for clusters in load store (#3880) 2020-09-22 14:26:20 -07:00
Easwar Swaminathan b5802b5f3b
xds: v3 support for LRS. (#3856) 2020-09-01 16:56:52 -07:00
Easwar Swaminathan 0f73133e3a
xds: Export a WatchListener() method on the xdsClient. (#3817) 2020-08-18 15:40:27 -07:00
Easwar Swaminathan b2f0b7930d
xds: Pass WatchExpiryTimeout to Client via Options. (#3784)
Tests can pass a different value when necessary. This avoids overriding a global variable from tests, leading to unnecessary races.
2020-08-05 14:37:15 -07:00
Easwar Swaminathan 97c30a1419
xds: Client refactor in preparation for xDS v3 support (#3743) 2020-07-30 10:27:09 -07:00
Easwar Swaminathan d8193ee9cc
xds: Add v3 support for client bootstrap. (#3723) 2020-07-09 16:23:28 -07:00
Menghan Li 3de8449f85
xds: use logging components (#3718) 2020-06-30 12:04:42 -07:00
Menghan Li ff40ef4227
xds: refactor xds_client (#3477)
This PR refactors xds_client to support multiples watches. Those watches can be for the same type and same resource_name.

There's upper level `Client` and lower level `v2client`. Before this change, all logic was in `v2client`, and `Client` was a thin wrapper.

This PR moves some of the functionality from `v2client` to `Client`. New layers:

- Upper level `Client`
  - keeps a list of watchers
    - provides method `func WatchXXX() (cancel func())`
    - has `WatchService()` which involves `LDS` and `RDS`
  - handles resources from the xDS responses and dispatch to the watchers
    - including multiple watchers for the same resource_name
  - keeps cache
    - and checks cache for new watches

- Lower level `v2client`
  - is a dumb client that
    - manages ADS stream
    - sends a new xDS request when add/remove watch
    - parses xDS responses
      - It doesn't call watchers, but forwards all parsed results to upper Client
    - handles ACK/NACK
  - supports `addWatch(type, name)` and `removeWatch(type, name)`
    - instead of `func watchCDS() func()`, which is now moved up to upper `Client`

Also includes other changes:
 - Corresponding test changes (some tests for `v2client` were moved to `Client`)
 - Method and type renaming
   - CDS/EDS -> Cluster/Endpoints
 - callback functions all accept updates as non-pointers
2020-04-15 14:32:31 -07:00
Menghan Li 4e487c1661
xds: rename WatchEDS to WatchEndpoints in xds_client (#3447) 2020-03-12 13:42:44 -07:00
Menghan Li 73cf2d2ad6
xds: LRS send hostname in metadata (#3394)
- The first LRS req will send hostname in metadata
   - With key "PROXYLESS_CLIENT_HOSTNAME"
2020-02-28 09:41:56 -08:00
Menghan Li 7f5ddc8aee
xds: improve logging (#3386)
- More logs in xds bootstrap/resolver/cds/eds
  - Bootstrap file content/error
  - Request/response on ADS stream
  - Actions by client/resolver/balancer
  - Content of updates
- Logs prefixed with component name and id
  - `[xds-bootstrap]`
  - `[xds-client <address>]`
  - `[cds-lb <address>]`
  - `[eds-lb <address>]`
2020-02-26 17:50:07 -08:00
Easwar Swaminathan 822723f716
xds: Enable keepalives on the xds client channel. (#3335)
We are using some sane defaults for now:
KeepaliveTime: 5 minutes
KeepaliveTimeout: 20 seconds
PermitWithoutStream: false

This does differ with the defaults used internally, but we are OK with
it, because it is more important to have a reasonable value here than
having one that works for all deployments or even making this
configurable through the bootstrap file.
2020-01-28 13:57:42 -08:00
Easwar Swaminathan 7e7050be6a
xds: Minor refactoring, prep for CDS LB policy (#3211) 2019-11-26 11:11:54 -08:00
Menghan Li da649b3624
xds: use the shared xds client in eds balancer (#3197)
This PR removes the xds_client implementation from eds balancer, and replaces it with a xds_client wrapper. (The xds_client wrapper has very similar API as the old xds_client implementation, so the change in the eds balancer is minimal).

The eds balancer currently doesn't look for xds_client from attributes, and always creates a new xds_client. The attributes change will be done in a following up change.
2019-11-21 14:10:04 -08:00
Easwar Swaminathan 24b653e8cc
xds: Don't override dialFunc in xdsClient in tests. (#3191)
* Add a helper to the fakexds package to return a ClientConn talking to
  the fake server.
* Tests will make use of this ClientConn wherever required, or they will
  directly pass the fake server's address as the balancerName to the
  xdsclient.New() function, thus exercising that code path as well.
* Add grpc.WithTimeout to list in vet.sh
2019-11-20 09:02:53 -08:00
Easwar Swaminathan 5d4cc8affe
xds: Implementation of xds_resolver using LDS/RDS (#3183)
xds: Implementation of xds_resolver using LDS/RDS
2019-11-18 17:46:14 -08:00