open-consul/agent
Freddy 66e2def461
Only pass one hostname via EDS and prefer healthy ones (#8084)
Co-authored-by: Matt Keeler <mkeeler@users.noreply.github.com>

Currently when passing hostname clusters to Envoy, we set each service instance registered with Consul as an LbEndpoint for the cluster.

However, Envoy can only handle one per cluster:
[2020-06-04 18:32:34.094][1][warning][config] [source/common/config/grpc_subscription_impl.cc:87] gRPC config for type.googleapis.com/envoy.api.v2.Cluster rejected: Error adding/updating cluster(s) dc2.internal.ddd90499-9b47-91c5-4616-c0cbf0fc358a.consul: LOGICAL_DNS clusters must have a single locality_lb_endpoint and a single lb_endpoint, server.dc2.consul: LOGICAL_DNS clusters must have a single locality_lb_endpoint and a single lb_endpoint

Envoy is currently handling this gracefully by only picking one of the endpoints. However, we should avoid passing multiple to avoid these warning logs.

This PR:

* Ensures we only pass one endpoint, which is tied to one service instance.
* We prefer sending an endpoint which is marked as Healthy by Consul.
* If no endpoints are healthy we emit a warning and skip the cluster.
* If multiple unique hostnames are spread across service instances we emit a warning and let the user know which will be resolved.
2020-06-12 13:46:17 -06:00
..
ae agent: ensure node info sync and full sync. (#7189) 2020-02-06 15:30:58 +01:00
agentpb server: strip local ACL tokens from RPCs during forwarding if crossing datacenters (#7419) 2020-03-10 11:15:22 -05:00
cache agent/cache: remove error return from fetch 2020-04-17 11:55:01 -04:00
cache-types ci: Enabled SA2002 staticcheck check 2020-06-05 17:50:11 -04:00
checks tests: use constructor instead init (#8024) 2020-06-04 22:59:06 +02:00
config Merge pull request #7964 from hashicorp/dnephin/remove-patch-slice-of-maps-forward-compat 2020-06-08 19:53:04 -04:00
connect Setup intermediate_pki_path on secondary when using vault (#8001) 2020-06-05 21:36:22 +02:00
consul Merge pull request #7900 from hashicorp/dnephin/add-linter-staticcheck-2 2020-06-09 15:40:20 -04:00
debug
exec
local tests: ensure that the ServiceExists helper function normalizes entmeta (#8025) 2020-06-05 10:41:39 +02:00
metadata Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
mock checks: when a service does not exists in an alias, consider it failing (#7384) 2020-06-04 14:50:52 +02:00
pool pool: remove timeout parameter 2020-05-29 08:21:28 +02:00
proxycfg Only pass one hostname via EDS and prefer healthy ones (#8084) 2020-06-12 13:46:17 -06:00
router Merge pull request #7966 from hashicorp/pool_improvements 2020-06-04 08:56:26 +02:00
structs Allow users to set hosts to the wildcard specifier when TLS is disabled (#8083) 2020-06-11 10:03:06 -05:00
systemd
token Updates to allow for using an enterprise specific token as the agents token 2020-04-28 09:44:26 -04:00
xds Only pass one hostname via EDS and prefer healthy ones (#8084) 2020-06-12 13:46:17 -06:00
acl.go acl: remove the deprecated `acl_enforce_version_8` option (#7991) 2020-05-29 16:16:03 -05:00
acl_endpoint.go test: move some test helpers over from enterprise (#7754) 2020-05-01 14:52:15 -05:00
acl_endpoint_legacy.go Use encoding/json as JSON decoder instead of mapstructure (#6680) 2019-10-29 11:13:36 -07:00
acl_endpoint_legacy_test.go ci: Add staticcheck and fix most errors 2020-05-28 11:59:58 -04:00
acl_endpoint_test.go acl: add auth method for JWTs (#7846) 2020-05-11 20:59:29 -05:00
acl_test.go acl: remove the deprecated `acl_enforce_version_8` option (#7991) 2020-05-29 16:16:03 -05:00
agent.go acl: remove the deprecated `acl_enforce_version_8` option (#7991) 2020-05-29 16:16:03 -05:00
agent_endpoint.go Fix a number of problems found by staticcheck 2020-05-19 16:50:14 -04:00
agent_endpoint_test.go http: use default minsize for gzip handler. (#7354) 2020-06-08 10:10:08 +02:00
agent_oss.go Some boilerplate to allow for ACL Bootstrap disabling configurability 2020-04-28 09:42:46 -04:00
agent_test.go tests: use constructor instead init (#8024) 2020-06-04 22:59:06 +02:00
bindata_assetfs.go update bindata_assetfs.go 2020-05-28 14:39:37 -04:00
catalog_endpoint.go agent: add option to disable agent cache for HTTP endpoints (#8023) 2020-06-08 10:08:12 +02:00
catalog_endpoint_test.go ci: Enabled SA2002 staticcheck check 2020-06-05 17:50:11 -04:00
check.go Sync of OSS changes to support namespaces (#6909) 2019-12-09 21:26:41 -05:00
config_endpoint.go Add connect expose CLI command 2020-06-05 14:54:29 -07:00
config_endpoint_test.go Expect default enterprise metadata in gateway tests (#7664) 2020-04-20 09:02:35 -05:00
connect_auth.go Intentions ACL enforcement updates (#7028) 2020-01-13 15:51:40 -05:00
connect_ca_endpoint.go connect: Add AWS PCA provider (#6795) 2019-11-21 17:40:29 +00:00
connect_ca_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
coordinate_endpoint.go Use encoding/json as JSON decoder instead of mapstructure (#6680) 2019-10-29 11:13:36 -07:00
coordinate_endpoint_test.go Fix a number of problems found by staticcheck 2020-05-19 16:50:14 -04:00
denylist.go Replace whitelist/blacklist terminology with allowlist/denylist (#7971) 2020-05-29 14:19:16 -04:00
denylist_test.go Replace whitelist/blacklist terminology with allowlist/denylist (#7971) 2020-05-29 14:19:16 -04:00
discovery_chain_endpoint.go Merge pull request #7964 from hashicorp/dnephin/remove-patch-slice-of-maps-forward-compat 2020-06-08 19:53:04 -04:00
discovery_chain_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
dns.go Ingress Gateways for TCP services (#7509) 2020-04-16 14:00:48 -07:00
dns_oss.go Sync of OSS changes to support namespaces (#6909) 2019-12-09 21:26:41 -05:00
dns_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
enterprise_delegate_oss.go Update to use a consulent build tag instead of just ent (#5759) 2019-05-01 11:11:27 -04:00
event_endpoint.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
event_endpoint_test.go ci: Enabled SA2002 staticcheck check 2020-06-05 17:50:11 -04:00
federation_state_endpoint.go wan federation via mesh gateways (#6884) 2020-03-09 15:59:02 -05:00
health_endpoint.go Move ingress param to a new endpoint (#8081) 2020-06-10 13:07:15 -05:00
health_endpoint_test.go Move ingress param to a new endpoint (#8081) 2020-06-10 13:07:15 -05:00
http.go http: use default minsize for gzip handler. (#7354) 2020-06-08 10:10:08 +02:00
http_decode_test.go intentions: fix a bug in Intention.SetHash 2020-06-05 14:51:43 -04:00
http_oss.go http: migrate from instrumentation in s.wrap() to an s.enterpriseHandler() 2020-05-13 15:47:05 -07:00
http_oss_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
http_register.go Move ingress param to a new endpoint (#8081) 2020-06-10 13:07:15 -05:00
http_test.go http: use default minsize for gzip handler. (#7354) 2020-06-08 10:10:08 +02:00
intentions_endpoint.go Fix a couple bugs regarding intentions with namespaces (#7169) 2020-01-29 17:30:38 -05:00
intentions_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
keyring.go agent: sensible keyring error (#7272) 2020-02-13 20:35:09 +01:00
keyring_test.go Rename NewTestAgentWithFields to StartTestAgent 2020-03-31 17:14:55 -04:00
kvs_endpoint.go docs: add docs for kv_max_value_size (#7405) 2020-03-09 11:13:40 +01:00
kvs_endpoint_test.go Fix a number of problems found by staticcheck 2020-05-19 16:50:14 -04:00
notify.go
notify_test.go
operator_endpoint.go Use encoding/json as JSON decoder instead of mapstructure (#6680) 2019-10-29 11:13:36 -07:00
operator_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
prepared_query_endpoint.go agent: add option to disable agent cache for HTTP endpoints (#8023) 2020-06-08 10:08:12 +02:00
prepared_query_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
remote_exec.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
remote_exec_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
retry_join.go wan federation via mesh gateways (#6884) 2020-03-09 15:59:02 -05:00
retry_join_test.go wan federation via mesh gateways (#6884) 2020-03-09 15:59:02 -05:00
service_checks_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
service_manager.go Enable CLI to register terminating gateways (#7500) 2020-03-26 10:20:56 -06:00
service_manager_test.go Rename NewTestAgentWithFields to StartTestAgent 2020-03-31 17:14:55 -04:00
session_endpoint.go Fix session backwards incompatibility with 1.6.x and earlier. 2020-03-05 15:34:55 -05:00
session_endpoint_test.go ci: Add staticcheck and fix most errors 2020-05-28 11:59:58 -04:00
sidecar_service.go wan federation via mesh gateways (#6884) 2020-03-09 15:59:02 -05:00
sidecar_service_test.go Rename NewTestAgentWithFields to StartTestAgent 2020-03-31 17:14:55 -04:00
signal_unix.go
signal_windows.go
snapshot_endpoint.go Remove SnapshotRPC passthrough 2020-04-13 12:32:57 -04:00
snapshot_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
status_endpoint.go Allow forwarding of some status RPCs (#6198) 2019-07-25 14:26:22 -04:00
status_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
testagent.go acl: remove the deprecated `acl_enforce_version_8` option (#7991) 2020-05-29 16:16:03 -05:00
testagent_test.go
translate_addr.go Add the v1/catalog/node-services/:node endpoint (#7115) 2020-01-24 09:27:25 -05:00
txn_endpoint.go docs: add docs for kv_max_value_size (#7405) 2020-03-09 11:13:40 +01:00
txn_endpoint_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
ui_endpoint.go Gateway Services Nodes UI Endpoint (#7685) 2020-05-11 11:35:17 -06:00
ui_endpoint_test.go Fix a number of problems found by staticcheck 2020-05-19 16:50:14 -04:00
user_event.go agent: ensure that we always use the same settings for msgpack (#7245) 2020-02-07 15:50:24 -06:00
user_event_test.go Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
util.go agent: ensure that we always use the same settings for msgpack (#7245) 2020-02-07 15:50:24 -06:00
util_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
watch_handler.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
watch_handler_test.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00