Go to file
Derek Menteer 9e76d274ec
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
.changelog Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
.circleci test: refactor testcontainers and add peering integ tests (#15084) 2022-11-01 15:03:23 -04:00
.github Update go version to 1.19 2022-10-24 16:12:08 -04:00
.release Enable ironbank integration (#14931) 2022-10-11 10:27:06 -04:00
acl Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
agent Fix mesh gateway configuration with proxy-defaults (#15186) 2022-11-09 10:14:29 -06:00
api Bring back parameter ServerExternalAddresses in GenerateToken endpoint (#15267) 2022-11-08 14:55:18 -06:00
bench Gets benchmarks running again and does a rough pass for 0.7.1. 2016-11-29 13:02:26 -08:00
build-support Update go version to 1.19 2022-10-24 16:12:08 -04:00
command Bring back parameter ServerExternalAddresses in GenerateToken endpoint (#15267) 2022-11-08 14:55:18 -06:00
connect Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
contributing Move contributing to docs 2021-08-30 16:17:09 -04:00
docs fix: missing UDP field in checkType (#14885) 2022-10-05 15:57:21 -04:00
grafana add readme outlining how to edit and publish 2021-01-12 14:47:11 -08:00
internal Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
ipaddr Ensure Consul is IPv6 compliant (#5468) 2019-06-04 10:02:38 -04:00
lib Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
logging Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
proto Bring back parameter ServerExternalAddresses in GenerateToken endpoint (#15267) 2022-11-08 14:55:18 -06:00
proto-public Update hcp-scada-provider to fix diamond dependency problem with go-msgpack (#15185) 2022-11-07 11:34:30 -05:00
sdk Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
sentinel re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
service_os re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
snapshot Vendor in rpc mono repo for net/rpc fork, go-msgpack, msgpackrpc. (#12311) 2022-02-14 09:45:45 -08:00
test Avoid blocking child type updates on parent ack (#15083) 2022-11-07 18:10:42 -07:00
testrpc feat(cli): add initial peering cli commands 2022-09-01 17:20:13 -04:00
tlsutil Regenerate test certificates. (#15218) 2022-11-01 10:51:13 -05:00
tools/internal-grpc-proxy grpc: rename public/private directories to external/internal (#13721) 2022-07-13 16:33:48 +01:00
types agent: convert listener config to TLS types (#12522) 2022-03-24 15:32:25 -04:00
ui Merge pull request #15153 from hashicorp/ui/chore/update-icons-to-use-flight-icons-component 2022-10-27 15:21:56 -06:00
version chore: update main for release/1.14.x branch 2022-10-21 15:50:51 -04:00
website docs: fix links in ent-license faq (#15242) 2022-11-09 15:56:58 +01:00
.dockerignore Update the scripting 2018-06-14 21:42:47 -04:00
.gitattributes Initial commit 2013-11-04 14:15:27 -08:00
.gitignore chore: ignore vscode files 2022-07-25 12:31:58 -04:00
.golangci.yml Ignore ioutil linter messages 2022-10-24 16:12:08 -04:00
CHANGELOG.md changelog: update Vault CA provider policy guidance 2022-10-24 14:26:14 -07:00
Dockerfile Add version label to Docker image (#14204) 2022-08-18 14:41:34 -04:00
GNUmakefile build: ensure 'make dev-docker' also produces a matching CLI binary at the same time (#15188) 2022-10-28 15:21:05 -05:00
LICENSE Initial commit 2013-11-04 14:15:27 -08:00
NOTICE.md add copyright notice file 2018-07-09 10:58:26 -07:00
README.md Fixed broken links referring to tutorials running as local agent (#14954) 2022-10-11 13:01:29 -07:00
Vagrantfile Adds a basic Linux Vagrant setup, stolen from Nomad. 2017-10-06 08:10:12 -07:00
fixup_acl_move.sh Fixup script 2 2022-04-05 14:52:43 -07:00
go.mod Update hcp-scada-provider to fix diamond dependency problem with go-msgpack (#15185) 2022-11-07 11:34:30 -05:00
go.sum Update hcp-scada-provider to fix diamond dependency problem with go-msgpack (#15185) 2022-11-07 11:34:30 -05:00
main.go Refactor some functions for better enterprise use (#13280) 2022-05-30 09:46:55 -04:00

README.md

Consul logo Consul

Docker Pulls Go Report Card

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.

Consul provides several key features:

  • Multi-Datacenter - Consul is built to be datacenter aware, and can support any number of regions without complex configuration.

  • Service Mesh - Consul Service Mesh enables secure service-to-service communication with automatic TLS encryption and identity-based authorization. Applications can use sidecar proxies in a service mesh configuration to establish TLS connections for inbound and outbound connections with Transparent Proxy.

  • Service Discovery - Consul makes it simple for services to register themselves and to discover other services via a DNS or HTTP interface. External services such as SaaS providers can be registered as well.

  • Health Checking - Health Checking enables Consul to quickly alert operators about any issues in a cluster. The integration with service discovery prevents routing traffic to unhealthy hosts and enables service level circuit breakers.

  • Key/Value Storage - A flexible key/value store enables storing dynamic configuration, feature flagging, coordination, leader election and more. The simple HTTP API makes it easy to use anywhere.

Consul runs on Linux, macOS, FreeBSD, Solaris, and Windows and includes an optional browser based UI. A commercial version called Consul Enterprise is also available.

Please note: We take Consul's security and our users' trust very seriously. If you believe you have found a security issue in Consul, please responsibly disclose by contacting us at security@hashicorp.com.

Quick Start

A few quick start guides are available on the Consul website:

Documentation

Full, comprehensive documentation is available on the Consul website: https://consul.io/docs

Contributing

Thank you for your interest in contributing! Please refer to CONTRIBUTING.md for guidance. For contributions specifically to the browser based UI, please refer to the UI's README.md for guidance.