Commit Graph

21297 Commits (9392f01bf457b55d6b74c325a00adda3af3cfe85)

Author SHA1 Message Date
hc-github-team-consul-core 9191ec6f5c
Backport of set up ent and CE specific DNS tests to be able to run v1 and v2 into release/1.18.x (#20579)
backport of commit 1567cc44e4

Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-10 10:45:12 -07:00
hc-github-team-consul-core 8728d17d6e
Backport of feat(v2dns): catalog v2 service query support into release/1.18.x (#20578)
backport of commit b0effe2e79

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2024-02-09 21:52:09 -05:00
Valeriia Ruban 539c5f4d0f
Backport/cc 7147 link to hcp modal/kindly verified snipe manually (#20580)
* feat: add link hcp modal component
---------

Co-authored-by: Chris Hut <tophernuts@gmail.com>
2024-02-09 15:34:18 -08:00
Valeriia Ruban 6cc864451e
chor: remove temporary CONSUL_HCP_LINK_ENABLED env flag (#20577) 2024-02-09 22:29:34 +00:00
Chris Hut 1890382a77
Backport/cc 7146/hcp link item in the nav bar (#20573)
* Convert consul-hcp to a simpler component

* update existing test to use envStub helper

* An hcp link item for the navbar

* A method of linking to HCP

* Hook up fetching linking status to the nav-item

* Hooking up fetching link status to the hcp link friend

* Adding some tests

* remove a comment - but also fix padding justify-content

* Fix the banner tests

* Adding permission tests as well

* some more sane formatting

* Rename function with its now multipurpose use

* Feature change: No more NEW Badge since it breaks padding - instead a linked badge

* Removing unused class
2024-02-09 14:17:18 -08:00
hc-github-team-consul-core ac75e94691
Backport of docs: Add legacy api gateway deprecation to Consul release notes into release/1.18.x (#20576)
* backport of commit 610892e6d1

* backport of commit a14018b6a8

* backport of commit aebdd6b473

---------

Co-authored-by: David Yu <dyu@hashicorp.com>
2024-02-09 14:04:12 -08:00
hc-github-team-consul-core ccc3c53d3e
Backport of mesh: add ComputedImplicitDestinations resource for future use into release/1.18.x (#20572)
mesh: add ComputedImplicitDestinations resource for future use (#20547)

Creates a new controller to create ComputedImplicitDestinations resources by
composing ComputedRoutes, Services, and ComputedTrafficPermissions to
infer all ParentRef services that could possibly send some portion of traffic to a
Service that has at least one accessible Workload Identity. A followup PR will
rewire the sidecar controller to make use of this new resource.

As this is a performance optimization, rather than a security feature the following
aspects of traffic permissions have been ignored:

- DENY rules
- port rules (all ports are allowed)

Also:

- Add some v2 TestController machinery to help test complex dependency mappers.

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
2024-02-09 21:54:25 +00:00
hc-github-team-consul-core 8e7814cd23
Backport of Allow reuse of cache indexes into release/1.18.x (#20567)
backport of commit 8d79ae81ed

Co-authored-by: Matt Keeler <mjkeeler7@gmail.com>
2024-02-09 13:25:28 -06:00
hc-github-team-consul-core 4576777832
Backport of feat(v2dns): prepared query ttls into release/1.18.x (#20565)
backport of commit eabd7bff65

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2024-02-09 12:40:24 -05:00
hc-github-team-consul-core 4a22e009c1
Backport of Decouple xds capacity controller and raft-autopilot into release/1.18.x (#20551)
* backport of commit 1668a314c6

* backport of commit d33eda97be

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-02-09 08:01:42 -06:00
hc-github-team-consul-core 981288e408
Backport of NET-7637 / NET-7659/NET-7636/NET-7647/NET-7648/NET-7646/NET-7649/NET-7645 - Multiple DNS v2 fixes into release/1.18.x (#20561)
* no-op commit due to failed cherry-picking

* Do not parallelize DNS tests because they consume too many ports (#20482)

---------

Co-authored-by: temp <temp@hashicorp.com>
Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-09 04:56:59 +00:00
hc-github-team-consul-core 112201a96b
Backport of Add default intention policy into release/1.18.x (#20546)
* backport of commit 78411b5f56

* backport of commit 0da74f73b5

---------

Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
2024-02-08 21:12:02 +00:00
hc-github-team-consul-core e72afa654d
Backport of Fix: avoid redundant logs on failures to export metrics into release/1.18.x (#20541)
* backport of commit 47c5c8b7a1

* backport of commit 291bbf3cec

---------

Co-authored-by: Joshua Timmons <joshua.timmons1@gmail.com>
2024-02-08 17:35:03 +00:00
hc-github-team-consul-core b8870c4a1c
Backport of Move sameness groups to v2beta1 version into release/1.18.x (#20534)
backport of commit ee2492191b

Co-authored-by: Eric <eric@haberkorn.co>
2024-02-08 11:40:26 -05:00
hc-github-team-consul-core 3ec6faff6f
Backport of Fix logging when we fail to export metrics to hcp into release/1.18.x (#20533) 2024-02-08 11:38:16 -05:00
hc-github-team-consul-core e309d51a5b
Backport of DNS v2 Multiple fixes. into release/1.18.x (#20530)
* no-op commit due to failed cherry-picking

* DNS v2 Multiple fixes. (#20525)

* DNS v2 Multiple fixes.

* add license header

* get rid of DefaultIntentionPolicy change that was not supposed to be there.

---------

Co-authored-by: temp <temp@hashicorp.com>
Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-08 05:20:09 +00:00
hc-github-team-consul-core 044185e541
Backport of [CC-7434] Skip collecting data directory metrics in dev mode into release/1.18.x (#20529)
* backport of commit 5d591bbdfb

* backport of commit cdfb10b454

---------

Co-authored-by: Melissa Kam <mkam@hashicorp.com>
2024-02-07 17:25:37 -06:00
hc-github-team-consul-core add938047f
Backport of [NET-7657] Remove proto definitions for GatewayClass + GatewayClassConfig into release/1.18.x (#20524)
backport of commit 33fc2f93bb

Co-authored-by: Nathan Coleman <nathan.coleman@hashicorp.com>
2024-02-07 22:18:12 +00:00
hc-github-team-consul-core 19daa99ef8
Backport of add traffic permissions excludes and tests into release/1.18.x (#20520)
* backport of commit 356d7a954e

* backport of commit 96bf768213

* backport of commit f3e0535568

---------

Co-authored-by: skpratt <sarah.pratt@hashicorp.com>
2024-02-07 15:48:33 -06:00
hc-github-team-consul-core 8d9fdc3a59
Backport of V1 Compat Exported Services Controller Optimizations into release/1.18.x (#20518)
* V1 Compat Exported Services Controller Optimizations (#20517)

V1 compat exported services controller optimizations

* Don't start the v2 exported services controller in v1 mode.
* Use the controller cache.

* Trigger the V1 Compat exported-services Controller when V1 Config Entries are Updated (#20456)

* Trigger the v1 compat exported-services controller when the v1 config entry is modified.

* Hook up exported-services config entries to the event publisher.
* Add tests to the v2 exported services shim.
* Use the local materializer trigger updates on the v1 compat exported services controller when exported-services config entries are modified.

* stop sleeping when context is cancelled

---------

Co-authored-by: Eric Haberkorn <erichaberkorn@gmail.com>
2024-02-07 16:03:36 -05:00
hc-github-team-consul-core 1dcf05d66b
Backport of add more integration tests into release/1.18.x (#20509)
* backport of commit 0047b381a0

* backport of commit 7057901317

---------

Co-authored-by: Xinyi Wang <xinyi.wang@hashicorp.com>
2024-02-06 11:50:05 -08:00
hc-github-team-consul-core a118821da7
Backport of NET-7630 - Fix TXT record creation on node queries into release/1.18.x (#20500)
NET-7630 - Fix TXT record creation on node queries (#20483)

Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-06 18:57:11 +00:00
hc-github-team-consul-core d9bedd02dc
Backport of NET-7631 - Fix Node records that point to external/ non-IP addresses into release/1.18.x (#20502)
NET-7631 - Fix Node records that point to external/ non-IP addresses (#20491)

* NET-7630 - Fix TXT record creation on node queries

* NET-7631 - Fix Node records that point to external/ non-IP addresses

* NET-7630 - Fix TXT record creation on node queries

Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-06 18:31:25 +00:00
hc-github-team-consul-core 51419de72c
Backport of Panic for unregistered types into release/1.18.x (#20504)
* backport of commit 392b8d7573

* backport of commit b4716599ae

* backport of commit a03cb97cb0

* backport of commit 73b277cdef

* backport of commit e53b9794c8

---------

Co-authored-by: Matt Keeler <mjkeeler7@gmail.com>
2024-02-06 12:48:50 -05:00
Tauhid Anjum ddb2987612
Manual Backport of Exported services CLI and docs into release/1.18.x (#20331) (#20493)
Exported services CLI and docs (#20331)

* Exported services CLI and docs

* Changelog added

* Added format option for pretty print

* Update command/exportedservices/exported_services.go



* Addressing PR comments, moving the command under services category

* Add consumer peer and partition filter

* Adding bexpr filter, change format of data

---------

Co-authored-by: Ashesh Vidyut <134911583+absolutelightning@users.noreply.github.com>
2024-02-06 12:07:30 +05:30
hc-github-team-consul-core 0ad0d4077b
Backport of Fix issue with persisting proxy-defaults into release/1.18.x (#20489)
* backport of commit b5c6c1da83

* backport of commit 1b7dbd7eea

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-02-05 16:27:45 -06:00
hc-github-team-consul-core 5a2b53b7bd
Backport of internal/hcp: prevent write loop on telemetrystate resource updates into release/1.18.x (#20465)
* backport of commit 2069bd134a

* backport of commit c0446fd670

* backport of commit 5227cc2bf1

---------

Co-authored-by: Nick Ethier <nethier@hashicorp.com>
2024-02-05 18:25:54 +00:00
hc-github-team-consul-core 44d1d51f70
Backport of feat(v2dns): catalog v2 workload query support into release/1.18.x (#20469)
backport of commit dfe82b9e5a

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2024-02-04 17:14:10 -05:00
hc-github-team-consul-core a49f2d0d59
Backport of catalog: improve the bound workload identity encoding on services into release/1.18.x (#20467)
catalog: improve the bound workload identity encoding on services (#20458)

The endpoints controller currently encodes the list of unique workload identities 
referenced by all workload matched by a Service into a special data-bearing 
status condition on that Service. This allows a downstream controller to avoid an 
expensive watch on the ServiceEndpoints type just to get this data.

The current encoding does not lend itself well to machine parsing, which is what 
the field is meant for, so this PR simplifies the encoding from:

    "blah blah: " + strings.Join(ids, ",") + "."

to

    strings.Join(ids, ",")

It also provides an exported utility function to easily extract this data.

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
2024-02-02 22:48:02 +00:00
hc-github-team-consul-core f3b80ddcba
Backport of v2: ensure the controller caches are fully populated before first use into release/1.18.x (#20462)
v2: ensure the controller caches are fully populated before first use (#20421)

The new controller caches are initialized before the DependencyMappers or the 
Reconciler run, but importantly they are not populated. The expectation is that 
when the WatchList call is made to the resource service it will send an initial 
snapshot of all resources matching a single type, and then perpetually send 
UPSERT/DELETE events afterward. This initial snapshot will cycle through the 
caching layer and will catch it up to reflect the stored data.

Critically the dependency mappers and reconcilers will race against the restoration 
of the caches on server startup or leader election. During this time it is possible a
 mapper or reconciler will use the cache to lookup a specific relationship and 
not find it. That very same reconciler may choose to then recompute some 
persisted resource and in effect rewind it to a prior computed state.

Change

- Since we are updating the behavior of the WatchList RPC, it was aligned to 
  match that of pbsubscribe and pbpeerstream using a protobuf oneof instead of the enum+fields option.

- The WatchList rpc now has 3 alternating response events: Upsert, Delete, 
  EndOfSnapshot. When set the initial batch of "snapshot" Upserts sent on a new 
  watch, those operations will be followed by an EndOfSnapshot event before beginning 
  the never-ending sequence of Upsert/Delete events.

- Within the Controller startup code we will launch N+1 goroutines to execute WatchList 
  queries for the watched types. The UPSERTs will be applied to the nascent cache
   only (no mappers will execute).

- Upon witnessing the END operation, those goroutines will terminate.

- When all cache priming routines complete, then the normal set of N+1 long lived 
watch routines will launch to officially witness all events in the system using the 
primed cached.

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
2024-02-02 22:08:47 +00:00
hc-github-team-consul-core ef155d20a1
Backport of Debug failing CICD tests into release/1.18.x (#20463)
backport of commit 901da4545d

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-02-02 15:50:51 -06:00
hc-github-team-consul-core 9163afe0cd
Backport of missing prefix / into release/1.18.x (#20459)
* backport of commit b76447fb80

* backport of commit 395984c444

* backport of commit cc1246d8ba

* backport of commit 43170a5a70

---------

Co-authored-by: Xinyi Wang <xinyi.wang@hashicorp.com>
2024-02-02 13:12:12 -08:00
hc-github-team-consul-core 531887380d
Backport of Fix SDK iptables.Config marshalling into release/1.18.x (#20454)
backport of commit 96e7a9790f

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-02-02 19:08:28 +00:00
hc-github-team-consul-core 379d69dc6c
Backport of Fix typo into release/1.18.x (#20449)
backport of commit 0ddd1cde2f

Co-authored-by: Luke Kysow <1034429+lkysow@users.noreply.github.com>
2024-02-01 14:58:25 -08:00
hc-github-team-consul-core 1d058198af
Backport of Change the multicluster group to v2 into release/1.18.x (#20436)
backport of commit 63d711b379

Co-authored-by: Eric <eric@haberkorn.co>
2024-02-01 12:34:47 -05:00
Melisa Griffin 7c00d396cf
[NET-6417] Add validation of MeshGateway name + listeners (#20425)
* Add validation of MeshGateway name + listeners

* Adds test for ValidateMeshGateway

* Fixes data fetcher test for gatewayproxy

---------

Co-authored-by: Nathan Coleman <nathan.coleman@hashicorp.com>
2024-01-31 18:47:57 -05:00
Chris S. Kim b6f10bc58f
Skip filter chain created by permissive mtls (#20406) 2024-01-31 16:39:12 -05:00
wangxinyi7 3b44be530d
only forwarding the resource service traffic in client agent to server agent (#20347)
* only forwarding the resource service traffic in client agent to server agent
2024-01-31 12:05:47 -08:00
Nick Ethier 383d92e9ab
hcp.v2.TelemetryState resource and controller implementation (#20257)
* pbhcp: add TelemetryState resource

* agent/hcp: add GetObservabilitySecrets to client

* internal/hcp: add TelemetryState controller logic

* hcp/telemetry-state: added config options for hcp sdk and debug key to skip deletion during reconcile

* pbhcp: update proto documentation

* hcp: address PR feedback, additional validations and code cleanup

* internal/hcp: fix type sig change in test

* update testdata/v2-resource-dependencies
2024-01-31 14:47:05 -05:00
Derek Menteer 3e8ec8d18e
Fix SAN matching on terminating gateways (#20417)
Fixes issue: hashicorp/consul#20360

A regression was introduced in hashicorp/consul#19954 where the SAN validation
matching was reduced from 4 potential types down to just the URI.

Terminating gateways will need to match on many fields depending on user
configuration, since they make egress calls outside of the cluster. Having more
than one matcher behaves like an OR operation, where any match is sufficient to
pass the certificate validation. To maintain backwards compatibility with the
old untyped `match_subject_alt_names` Envoy behavior, we should match on all 4
enum types.

https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/transport_sockets/tls/v3/common.proto#enum-extensions-transport-sockets-tls-v3-subjectaltnamematcher-santype
2024-01-31 12:17:45 -06:00
cskh 890332cacb
docs: Fix indention of wal object in agent config (#20399) 2024-01-31 11:24:00 -05:00
Nathan Coleman 74e4200d07
[NET-6429] Program ProxyStateTemplate to route cross-partition traffi… (#20410)
[NET-6429] Program ProxyStateTemplate to route cross-partition traffic to the correct destination mesh gateway

* Program mesh port to route wildcarded gateway SNI to the appropriate remote partition's mesh gateway

* Update target + route ports in service endpoint refs when building PST

* Use proper name of local datacenter when constructing SNI for gateway target

* Use destination identities for TLS when routing L4 traffic through the mesh gateway

* Use new constants, move comment to correct location

* Use new constants for port names

* Update test assertions

* Undo debug logging change
2024-01-31 10:46:04 -05:00
John Murret c82b78b088
NET-7165 - fix address and target setting (#20403) 2024-01-30 15:34:35 -07:00
Ronald 8799c36410
[NET-6231] Handle Partition traffic permissions when reconciling traffic permissions (#20408)
[NET-6231] Partition traffic permissions

Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
2024-01-30 22:14:32 +00:00
NicoletaPopoviciu b7b9bb0e83
Update Vault/Nomad versions. (#20322)
Update Vault/Nomad versions to ensure we're testing all the latest versions.

Update Vault/Nomad versions to ensure we're testing all the latest versions .
2024-01-30 16:36:08 -05:00
Chris S. Kim 7cc88a1577
Handle NamespaceTrafficPermissions when reconciling TrafficPermissions (#20407) 2024-01-30 21:31:25 +00:00
Nathan Coleman 21b3c18d5d
Use a full EndpointRef on ComputedRoutes targets instead of just the ID (#20400)
* Use a full EndpointRef on ComputedRoutes targets instead of just the ID

Today, the `ComputedRoutes` targets have the appropriate ID set for their `ServiceEndpoints` reference; however, the `MeshPort` and `RoutePort` are assumed to be that of the target when adding the endpoints reference in the sidecar's `ProxyStateTemplate`.

This is problematic when the target lives behind a `MeshGateway` and the `Mesh/RoutePort` used in the sidecar's `ProxyStateTemplate` should be that of the `MeshGateway` instead of the target.

Instead of assuming the `MeshPort` and `RoutePort` when building the `ProxyStateTemplate` for the sidecar, let's just add the full `EndpointRef` -- including the ID and the ports -- when hydrating the computed destinations.

* Make sure the UID from the existing ServiceEndpoints makes it onto ComputedRoutes

* Update test assertions

* Undo confusing whitespace change

* Remove one-line function wrapper

* Use plural name for endpoints ref

* Add constants for gateway name, kind and port names
2024-01-30 16:25:44 -05:00
Ronald 783f33db3b
[NET-7074] Exported Services typo fix (#20402) 2024-01-30 21:08:36 +00:00
wangxinyi7 3c5cb04b0f
refactor the resource client (#20343)
* renaming files
2024-01-30 12:33:44 -08:00
wangxinyi7 2b89025eab
clean up http client (#20342)
clean up http client
2024-01-30 10:12:09 -08:00