consul/agent/xds
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
..
proxysupport connect: Add Envoy 1.24 to integration tests, remove Envoy 1.20 (#15093) 2022-10-31 10:50:45 -05:00
serverlessplugin Fix spelling mistake in serverless patcher (#13607) 2022-06-29 15:21:21 -04:00
testdata Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
xdscommon peering: update how cross-peer upstreams and represented in proxycfg and rendered in xds (#13362) 2022-06-03 16:42:50 -05:00
clusters.go Update hcp-scada-provider to fix diamond dependency problem with go-msgpack (#15185) 2022-11-07 11:34:30 -05:00
clusters_test.go ingress-gateways: don't log error when registering gateway (#15001) 2022-10-25 10:55:44 -07:00
config.go Extend tcp keepalive settings to work for terminating gateways as well 2022-10-14 17:05:46 -07:00
config_test.go Add envoy connection balancing. (#14616) 2022-09-26 11:29:06 -05:00
delta.go Avoid blocking child type updates on parent ack (#15083) 2022-11-07 18:10:42 -07:00
delta_test.go Avoid blocking child type updates on parent ack (#15083) 2022-11-07 18:10:42 -07:00
endpoints.go Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
endpoints_test.go ingress-gateways: don't log error when registering gateway (#15001) 2022-10-25 10:55:44 -07:00
envoy_versioning.go connect: Add Envoy 1.24 to integration tests, remove Envoy 1.20 (#15093) 2022-10-31 10:50:45 -05:00
envoy_versioning_test.go connect: Add Envoy 1.24 to integration tests, remove Envoy 1.20 (#15093) 2022-10-31 10:50:45 -05:00
failover_math.go xds: default to speaking xDS v3, but allow for v2 to be spoken upon request (#9658) 2021-02-26 16:23:15 -06:00
failover_math_test.go Cluster peering failover disco chain changes (#14296) 2022-08-23 09:13:43 -04:00
golden_test.go connect: Add Envoy 1.21.1 to support matrix, remove 1.17.4 (#12777) 2022-04-14 10:44:42 -07:00
listeners.go chore: update golangci-lint to v1.50.1 (#15022) 2022-10-24 11:48:02 -05:00
listeners_ingress.go Configure Envoy alpn_protocols based on service protocol (#14356) 2022-10-10 13:13:56 -07:00
listeners_test.go ingress-gateways: don't log error when registering gateway (#15001) 2022-10-25 10:55:44 -07:00
naming.go connect: generate the full SNI names for discovery targets in the compiler rather than in the xds package (#6340) 2019-08-19 13:03:03 -05:00
net_fallback.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
net_linux.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
protocol_trace.go Support Incremental xDS mode (#9855) 2021-04-29 13:54:05 -05:00
rbac.go Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
rbac_test.go xds: modify rbac rules to use the XFCC header for peered L7 enforcement (#13629) 2022-06-29 10:29:54 -05:00
resources.go xds: remove HTTPCheckFetcher dependency (#13366) 2022-06-06 15:15:33 +01:00
resources_oss_test.go xds: begin refactor to always pass test snapshots through all xDS types (#13461) 2022-06-15 14:58:28 -05:00
resources_test.go feat: xDS updates for peerings control plane through mesh gw 2022-10-07 08:46:42 -06:00
response.go Continue working through proxy and agent 2021-05-04 12:41:43 -07:00
routes.go Add the ability to retry on reset connection to service-routers (#12890) 2022-10-05 13:06:44 -04:00
routes_test.go ingress-gateways: don't log error when registering gateway (#15001) 2022-10-25 10:55:44 -07:00
server.go Add consul.xds.server.streamStart metric (#14957) 2022-10-12 14:17:58 -05:00
server_oss.go Fixup acl.EnterpriseMeta 2022-04-05 15:11:49 -07:00
serverless_plugin_oss_test.go Fix spelling mistake in serverless patcher (#13607) 2022-06-29 15:21:21 -04:00
testing.go xds: fix for delta xDS reconnect bug in LDS/CDS (#12174) 2022-01-25 11:24:27 -06:00
xds.go Remove unused customEDSClusterJSON 2020-03-27 15:38:16 -04:00
xds_protocol_helpers_test.go xDS Load Balancing (#14397) 2022-09-09 15:02:01 +01:00
z_xds_packages.go Add connection limit setting to service defaults 2022-05-24 10:13:38 -07:00
z_xds_packages_test.go xds: ensure that all envoyproxy/go-control-plane protobuf symbols are linked into the final binary (#10131) 2021-04-29 14:58:26 -05:00