consul/agent/xds/testdata
Derek Menteer 418bd62c44
Fix mesh gateway configuration with proxy-defaults (#15186)
* Fix mesh gateway proxy-defaults not affecting upstreams.

* Clarify distinction with upstream settings

Top-level mesh gateway mode in proxy-defaults and service-defaults gets
merged into NodeService.Proxy.MeshGateway, and only gets merged with
the mode attached to an an upstream in proxycfg/xds.

* Fix mgw mode usage for peered upstreams

There were a couple issues with how mgw mode was being handled for
peered upstreams.

For starters, mesh gateway mode from proxy-defaults
and the top-level of service-defaults gets stored in
NodeService.Proxy.MeshGateway, but the upstream watch for peered data
was only considering the mesh gateway config attached in
NodeService.Proxy.Upstreams[i]. This means that applying a mesh gateway
mode via global proxy-defaults or service-defaults on the downstream
would not have an effect.

Separately, transparent proxy watches for peered upstreams didn't
consider mesh gateway mode at all.

This commit addresses the first issue by ensuring that we overlay the
upstream config for peered upstreams as we do for non-peered. The second
issue is addressed by re-using setupWatchesForPeeredUpstream when
handling transparent proxy updates.

Note that for transparent proxies we do not yet support mesh gateway
mode per upstream, so the NodeService.Proxy.MeshGateway mode is used.

* Fix upstream mesh gateway mode handling in xds

This commit ensures that when determining the mesh gateway mode for
peered upstreams we consider the NodeService.Proxy.MeshGateway config as
a baseline.

In absense of this change, setting a mesh gateway mode via
proxy-defaults or the top-level of service-defaults will not have an
effect for peered upstreams.

* Merge service/proxy defaults in cfg resolver

Previously the mesh gateway mode for connect proxies would be
merged at three points:

1. On servers, in ComputeResolvedServiceConfig.
2. On clients, in MergeServiceConfig.
3. On clients, in proxycfg/xds.

The first merge returns a ServiceConfigResponse where there is a
top-level MeshGateway config from proxy/service-defaults, along with
per-upstream config.

The second merge combines per-upstream config specified at the service
instance with per-upstream config specified centrally.

The third merge combines the NodeService.Proxy.MeshGateway
config containing proxy/service-defaults data with the per-upstream
mode. This third merge is easy to miss, which led to peered upstreams
not considering the mesh gateway mode from proxy-defaults.

This commit removes the third merge, and ensures that all mesh gateway
config is available at the upstream. This way proxycfg/xds do not need
to do additional overlays.

* Ensure that proxy-defaults is considered in wc

Upstream defaults become a synthetic Upstream definition under a
wildcard key "*". Now that proxycfg/xds expect Upstream definitions to
have the final MeshGateway values, this commit ensures that values from
proxy-defaults/service-defaults are the default for this synthetic
upstream.

* Add changelog.

Co-authored-by: freddygv <freddy@hashicorp.com>
2022-11-09 10:14:29 -06:00
..
clusters Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
endpoints Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
listeners Backport various fixes from ENT. (#15254) 2022-11-03 16:34:57 -05:00
rbac xds: modify rbac rules to use the XFCC header for peered L7 enforcement (#13629) 2022-06-29 10:29:54 -05:00
routes ingress-gateways: don't log error when registering gateway (#15001) 2022-10-25 10:55:44 -07:00
serverless_plugin Fix spelling mistake in serverless patcher (#13607) 2022-06-29 15:21:21 -04:00
alt-test-leaf-cert.golden Use golden files for gateway certs and fix listener test flakiness 2020-04-27 11:08:41 -06:00
alt-test-leaf-key.golden Use golden files for gateway certs and fix listener test flakiness 2020-04-27 11:08:41 -06:00
alt-test-root-cert.golden Use golden files for gateway certs and fix listener test flakiness 2020-04-27 11:08:41 -06:00
cache-test-leaf-cert.golden Always return a gateway cluster (#8158) 2020-06-19 13:31:39 -06:00
cache-test-leaf-key.golden Always return a gateway cluster (#8158) 2020-06-19 13:31:39 -06:00
db-test-leaf-cert.golden Always return a gateway cluster (#8158) 2020-06-19 13:31:39 -06:00
db-test-leaf-key.golden Always return a gateway cluster (#8158) 2020-06-19 13:31:39 -06:00
test-leaf-cert.golden Connect: allow configuring Envoy for L7 Observability (#5558) 2019-04-29 17:27:57 +01:00
test-leaf-key.golden Connect: allow configuring Envoy for L7 Observability (#5558) 2019-04-29 17:27:57 +01:00
test-root-cert.golden Connect: allow configuring Envoy for L7 Observability (#5558) 2019-04-29 17:27:57 +01:00