consul/agent/structs
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
..
aclfilter proxycfg: server-local intention upstreams data source 2022-07-04 10:48:36 +01:00
acl.go Add server certificate manager 2022-09-16 17:57:10 -06:00
acl_cache.go acl: gRPC login and logout endpoints (#12935) 2022-05-04 17:38:45 +01:00
acl_cache_test.go acl: gRPC login and logout endpoints (#12935) 2022-05-04 17:38:45 +01:00
acl_oss.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
acl_test.go acl: gRPC login and logout endpoints (#12935) 2022-05-04 17:38:45 +01:00
auto_encrypt.go
autopilot.go Switch to using the external autopilot module 2020-11-09 09:22:11 -05:00
autopilot_oss.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
catalog.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
catalog_oss.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
check_definition.go feat: windows service health checks 2022-06-07 18:27:14 +01:00
check_definition_test.go feat: windows service health checks 2022-06-07 18:27:14 +01:00
check_type.go feat: windows service health checks 2022-06-07 18:27:14 +01:00
config_entry.go Add envoy connection balancing. (#14616) 2022-09-26 11:29:06 -05:00
config_entry_discoverychain.go Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
config_entry_discoverychain_oss.go Add `Targets` field to service resolver failovers. (#14162) 2022-08-15 09:20:25 -04:00
config_entry_discoverychain_oss_test.go Update the structs and discovery chain for service resolver redirects to cluster peers. (#14366) 2022-08-29 09:51:32 -04:00
config_entry_discoverychain_test.go Add the ability to retry on reset connection to service-routers (#12890) 2022-10-05 13:06:44 -04:00
config_entry_export_oss_test.go Rename `PeerName` to `Peer` on prepared queries and exported services (#14854) 2022-10-04 14:46:15 -04:00
config_entry_exports.go Rename `PeerName` to `Peer` on prepared queries and exported services (#14854) 2022-10-04 14:46:15 -04:00
config_entry_exports_test.go Rename `PeerName` to `Peer` on prepared queries and exported services (#14854) 2022-10-04 14:46:15 -04:00
config_entry_gateways.go feat(ingress gateway: support configuring limits in ingress-gateway c… (#14749) 2022-09-28 14:56:46 -04:00
config_entry_gateways_test.go fix: multiple grpc/http2 services for ingress listeners 2022-05-26 10:43:58 -04:00
config_entry_intentions.go peering, state: account for peer intentions (#13443) 2022-06-16 10:27:31 -07:00
config_entry_intentions_oss.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
config_entry_intentions_test.go peering, state: account for peer intentions (#13443) 2022-06-16 10:27:31 -07:00
config_entry_mesh.go Update xds generation for peering over mesh gws 2022-10-03 12:42:27 -06:00
config_entry_mesh_oss.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
config_entry_mesh_test.go Update xds generation for peering over mesh gws 2022-10-03 12:42:27 -06:00
config_entry_oss.go peering: initial sync (#12842) 2022-04-21 17:34:40 -05:00
config_entry_oss_test.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
config_entry_test.go Rename `PeerName` to `Peer` on prepared queries and exported services (#14854) 2022-10-04 14:46:15 -04:00
connect.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
connect_ca.go Update intermediate pki mount/role when reconfiguring Vault provider 2022-09-13 15:42:26 -07:00
connect_ca_test.go add root_cert_ttl option for consul connect, vault ca providers (#11428) 2021-11-02 11:02:10 -07:00
connect_oss.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
connect_proxy_config.go Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
connect_proxy_config_oss.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
connect_proxy_config_test.go Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
deep-copy.sh perf: remove expensive reflection from xDS hot path (#14934) 2022-10-14 10:26:42 +01:00
discovery_chain.go Cluster peering failover disco chain changes (#14296) 2022-08-23 09:13:43 -04:00
discovery_chain_oss.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
errors.go Special case the error returned when we have a Raft leader but are not tracking it in the ServerLookup (#9487) 2021-01-04 14:05:23 -05:00
federation_state.go
identity.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
intention.go Add SourcePeer fields to relevant Intentions types (#13390) 2022-06-08 13:24:10 -04:00
intention_oss.go Manual Structs fixup 2022-04-05 14:51:10 -07:00
intention_test.go Add SourcePeer fields to relevant Intentions types (#13390) 2022-06-08 13:24:10 -04:00
operator.go Switch to using the external autopilot module 2020-11-09 09:22:11 -05:00
peering.go Bring back parameter ServerExternalAddresses in GenerateToken endpoint (#15267) 2022-11-08 14:55:18 -06:00
prepared_query.go Rename `PeerName` to `Peer` on prepared queries and exported services (#14854) 2022-10-04 14:46:15 -04:00
prepared_query_test.go structs: add two cache completeness tests types that implement cache.Request 2021-05-31 16:54:41 -04:00
protobuf_compat.go Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
sanitize_oss.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
service_definition.go peering: Make Upstream peer-aware (#12900) 2022-04-29 18:12:51 -04:00
service_definition_test.go bulk rewrite using this script 2022-01-20 10:46:23 -06:00
snapshot.go
structs.deepcopy.go perf: remove expensive reflection from xDS hot path (#14934) 2022-10-14 10:26:42 +01:00
structs.go Refactor client RPC timeouts (#14965) 2022-10-18 15:05:09 -04:00
structs_filtering_test.go Add SourcePeer fields to relevant Intentions types (#13390) 2022-06-08 13:24:10 -04:00
structs_oss.go peering: accept replication stream of discovery chain information at the importing side (#13151) 2022-05-19 16:37:52 -05:00
structs_oss_test.go add new entmeta stuff. 2022-04-05 14:49:31 -07:00
structs_test.go Separate port and socket path requirement in case of local agent assignment 2022-07-29 13:28:21 -05:00
system_metadata.go Add virtual IP generation for term gateway backed services 2022-01-12 12:08:49 -08:00
testing.go Vendor in rpc mono repo for net/rpc fork, go-msgpack, msgpackrpc. (#12311) 2022-02-14 09:45:45 -08:00
testing_catalog.go Make the mesh gateway changes to allow `local` mode for cluster peering data plane traffic (#14817) 2022-10-06 09:54:14 -04:00
testing_connect_proxy_config.go Add additional parameters to envoy passive health check config (#14238) 2022-09-01 09:59:11 -07:00
testing_intention.go Cleanup unnecessary normalizing method (#11169) 2021-09-28 15:31:12 -04:00
testing_service_definition.go
txn.go connect: intentions are now managed as a new config entry kind "service-intentions" (#8834) 2020-10-06 13:24:05 -05:00