Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure. https://www.consul.io
Go to file
R.B. Boyer 72f991d8d3
agent: remove agent cache dependency from service mesh leaf certificate management (#17075)
* agent: remove agent cache dependency from service mesh leaf certificate management

This extracts the leaf cert management from within the agent cache.

This code was produced by the following process:

1. All tests in agent/cache, agent/cache-types, agent/auto-config,
   agent/consul/servercert were run at each stage.

    - The tests in agent matching .*Leaf were run at each stage.

    - The tests in agent/leafcert were run at each stage after they
      existed.

2. The former leaf cert Fetch implementation was extracted into a new
   package behind a "fake RPC" endpoint to make it look almost like all
   other cache type internals.

3. The old cache type was shimmed to use the fake RPC endpoint and
   generally cleaned up.

4. I selectively duplicated all of Get/Notify/NotifyCallback/Prepopulate
   from the agent/cache.Cache implementation over into the new package.
   This was renamed as leafcert.Manager.

    - Code that was irrelevant to the leaf cert type was deleted
      (inlining blocking=true, refresh=false)

5. Everything that used the leaf cert cache type (including proxycfg
   stuff) was shifted to use the leafcert.Manager instead.

6. agent/cache-types tests were moved and gently replumbed to execute
   as-is against a leafcert.Manager.

7. Inspired by some of the locking changes from derek's branch I split
   the fat lock into N+1 locks.

8. The waiter chan struct{} was eventually replaced with a
   singleflight.Group around cache updates, which was likely the biggest
   net structural change.

9. The awkward two layers or logic produced as a byproduct of marrying
   the agent cache management code with the leaf cert type code was
   slowly coalesced and flattened to remove confusion.

10. The .*Leaf tests from the agent package were copied and made to work
    directly against a leafcert.Manager to increase direct coverage.

I have done a best effort attempt to port the previous leaf-cert cache
type's tests over in spirit, as well as to take the e2e-ish tests in the
agent package with Leaf in the test name and copy those into the
agent/leafcert package to get more direct coverage, rather than coverage
tangled up in the agent logic.

There is no net-new test coverage, just coverage that was pushed around
from elsewhere.
2023-06-13 10:54:45 -05:00
.changelog agent: remove agent cache dependency from service mesh leaf certificate management (#17075) 2023-06-13 10:54:45 -05:00
.github Delete check-legacy-links-format.yml (#17647) 2023-06-12 14:20:29 +00:00
.release Resolves issue-16844 - systemd notify by default (#16845) 2023-06-02 10:04:48 -07:00
acl server: wire up in-process Resource Service (#16978) 2023-04-18 10:03:23 +01:00
agent agent: remove agent cache dependency from service mesh leaf certificate management (#17075) 2023-06-13 10:54:45 -05:00
api [API Gateway] Fix rate limiting for API gateways (#17631) 2023-06-09 08:22:32 -04:00
bench
build-support Various bits of cleanup detected when using Go Workspaces (#17462) 2023-06-05 16:08:39 -04:00
command [NET-4107][Supportability] Log Level set to TRACE and duration set to 5m for consul-debug (#17596) 2023-06-13 11:07:46 +05:30
connect Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
contributing Move contributing to docs 2021-08-30 16:17:09 -04:00
docs docs: first pass at a resource/controller developer guide (#17395) 2023-05-24 15:49:32 +01:00
envoyextensions Update list of Envoy versions (#17546) 2023-06-09 02:37:49 +00:00
grafana add readme outlining how to edit and publish 2021-01-12 14:47:11 -08:00
internal Implement the service endpoints controller (#17216) 2023-06-06 17:09:48 -04:00
ipaddr Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
lib hoststats: add package for collecting host statistics including cpu memory and disk usage (#17038) 2023-05-30 18:43:29 +00:00
logging Controller Supervision (#17016) 2023-04-25 12:52:35 +01:00
proto Add Envoy and Consul version constraints to Envoy extensions (#17612) 2023-06-08 10:26:11 -04:00
proto-public Various bits of cleanup detected when using Go Workspaces (#17462) 2023-06-05 16:08:39 -04:00
sdk backport ent changes to oss (#17614) 2023-06-08 16:34:31 +00:00
sentinel Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
service_os Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
snapshot snapshot: some improvments to the snapshot process (#17236) 2023-05-09 15:28:52 -04:00
test Fix Property Override Services parsing (#17584) 2023-06-06 15:40:37 -04:00
testrpc Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
tlsutil update tests for fips (#17592) 2023-06-07 10:57:56 -05:00
tools/internal-grpc-proxy Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
troubleshoot Various bits of cleanup detected when using Go Workspaces (#17462) 2023-06-05 16:08:39 -04:00
types Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
ui ci: remove test-integrations CircleCI workflow (#16928) 2023-04-19 16:19:29 +00:00
version [OSS] Post Consul 1.16 updates (#17606) 2023-06-07 21:46:49 +00:00
website docs: Update default values for Envoy extension proxy types (#17676) 2023-06-13 07:04:01 -07:00
.copywrite.hcl Remove UI brand-loader copyright headers as they do not render appropriately (#16835) 2023-03-31 11:29:19 -04:00
.dockerignore
.gitignore Various bits of cleanup detected when using Go Workspaces (#17462) 2023-06-05 16:08:39 -04:00
.golangci.yml Various bits of cleanup detected when using Go Workspaces (#17462) 2023-06-05 16:08:39 -04:00
CHANGELOG.md Post 1.16.0-rc1 updates (#17663) 2023-06-12 14:28:51 -04:00
Dockerfile build(deps): update UBI base image to 9.2 (#17513) 2023-05-30 12:48:13 -04:00
GNUmakefile Add generic experiments configuration and use it to enable catalog v2 resources (#17604) 2023-06-12 11:32:43 -04:00
LICENSE [COMPLIANCE] Update MPL-2.0 LICENSE (#14964) 2022-11-09 12:24:14 -06:00
NOTICE.md
README.md Fixed broken links referring to tutorials running as local agent (#14954) 2022-10-11 13:01:29 -07:00
buf.work.yaml Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
fixup_acl_move.sh Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
go.mod Post 1.16.0-rc1 updates (#17663) 2023-06-12 14:28:51 -04:00
go.sum Various bits of cleanup detected when using Go Workspaces (#17462) 2023-06-05 16:08:39 -04:00
main.go Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -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.