Commit Graph

5463 Commits (2a1f2ad6c852cf57d7c3e4781ee182fa74630921)

Author SHA1 Message Date
hc-github-team-consul-core 751454595e
Backport of Fix audit-log encoding issue (CC-7337) into release/1.18.x (#20749)
Fix audit-log encoding issue (CC-7337) (#20345)

* add changes

* added changelog

* change update

* CE chnages

* Removed gzip size fix

* fix changelog

* Update .changelog/20345.txt



* Adding comments

---------

Co-authored-by: Ashesh Vidyut <134911583+absolutelightning@users.noreply.github.com>
Co-authored-by: Abhishek Sahu <abhishek.sahu@hashicorp.com>
Co-authored-by: Hans Hasselberg <hans@hashicorp.com>
Co-authored-by: srahul3 <rahulsharma@hashicorp.com>
2024-02-28 14:25:09 +05:30
hc-github-team-consul-core 72dbd17892
Backport of Use correct enterprise meta on wildcard service update into release/1.18.x (#20729)
* backport of commit 94a0aa2ea7

* backport of commit f0e1badd6f

* backport of commit 183dd2fb12

---------

Co-authored-by: Sarah Alsmiller <sarah.alsmiller@hashicorp.com>
2024-02-26 19:11:03 +00:00
hc-github-team-consul-core 1309b6a563
Backport of NET-7813 - DNS : SERVFAIL when resolving PTR records into release/1.18.x (#20693)
NET-7813 - DNS : SERVFAIL when resolving PTR records

Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-21 19:11:39 +00:00
Dan Stough e8d5ccdda3
[CE] fix(v2dns): allow secondary datacenters (#20657)
fix(v2dns): allow secondary datacenters
2024-02-15 17:42:29 -05:00
hc-github-team-consul-core 00a3f24fb4
Backport of fix(v2dns): add node ttl to workloads, comment cleanup, and changelog into release/1.18.x (#20650)
* backport of commit 5ffa4046f6

* backport of commit 17de0e4b57

---------

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2024-02-14 22:20:17 -05:00
hc-github-team-consul-core f98650655e
Backport of Ensure all topics are refreshed on FSM restore and add supervisor loop to v1 controller subscriptions into release/1.18.x (#20646)
* backport of commit 0eac0cd91f

* backport of commit f667f7c5e5

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-02-14 14:52:30 -06:00
hc-github-team-consul-core c475b8c6c6
Backport of [CE] Misc cleanup for V2 DNS into release/1.18.x (#20641)
* backport of commit 6661620907

* backport of commit 0cc49cbd12

* backport of commit 08c48a7381

* backport of commit 323858b3ca

* backport of commit 5a441e2d01

---------

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2024-02-14 13:40:47 -05:00
hc-github-team-consul-core 30f457c187
Backport of [CC-7411] Fix environment variable precedence when linking to HCP into release/1.18.x (#20626)
backport of commit 3df13d75c0

Co-authored-by: Melissa Kam <mkam@hashicorp.com>
2024-02-13 20:26:49 +00:00
hc-github-team-consul-core 4376f9f999
Backport of [NET-7015] DNS v2 + Catalog v2 int test into release/1.18.x (#20623)
backport of commit 43cac526a4

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
2024-02-13 18:03:50 +00:00
hc-github-team-consul-core 013d51f782
Backport of [CE] feat(v2dns): add v2 style query metrics into release/1.18.x (#20617)
backport of commit 95a869a380

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2024-02-13 12:55:13 -05:00
hc-github-team-consul-core f5f64e93bb
Backport of feat(v2dns): enable peering queries into release/1.18.x (#20591)
backport of commit 1209e260a7

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2024-02-12 14:59:29 -05:00
hc-github-team-consul-core 5b8e38cd88
Backport of NET-7644/NET-7634 - Implement query lookup for tagged addresses on nodes and services including WAN translation. into release/1.18.x (#20592)
NET-7644 - Implement tagged addresses and wan translation

Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-12 14:56:14 -05:00
hc-github-team-consul-core 01bbff30b5
Backport of Move HCP Manager lifecycle management out of Link controller into release/1.18.x (#20585)
* backport of commit 5f295967d5

* backport of commit 11b8cf722b

* backport of commit c76de7ee04

* backport of commit a276e68078

* backport of commit 1b5e05fb95

* backport of commit 89c795e158

* backport of commit f467df49e1

* backport of commit bd7724aa9d

* backport of commit 1d91dffbd1

* backport of commit 39afd08fa3

* backport of commit 73978b33eb

* backport of commit 8cadf2a29a

* backport of commit 0045294d7d

* backport of commit 3e21faeaa9

* backport of commit daa1962623

* backport of commit 9526e6f3d0

* backport of commit 291abcff89

* backport of commit 3b3a658fba

* backport of commit 5277975477

* backport of commit 5490d7586d

* backport of commit a920a1458f

---------

Co-authored-by: Nick Cellino <nick.cellino@hashicorp.com>
2024-02-12 11:30:50 -05:00
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
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 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 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 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
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 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 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 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 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
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
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
Chris S. Kim 7cc88a1577
Handle NamespaceTrafficPermissions when reconciling TrafficPermissions (#20407) 2024-01-30 21:31:25 +00:00
Melissa Kam b0e87dbe13
[CC-7049] Stop the HCP manager when link is deleted (#20351)
* Add Stop method to telemetry provider

Stop the main loop of the provider and set the config
to disabled.

* Add interface for telemetry provider

Added for easier testing. Also renamed Run to Start, which better
fits with Stop.

* Add Stop method to HCP manager

* Add manager interface, rename implementation

Add interface for easier testing, rename existing Manager to HCPManager.

* Stop HCP manager in link Finalizer

* Attempt to cleanup if resource has been deleted

The link should be cleaned up by the finalizer, but there's an edge
case in a multi-server setup where the link is fully deleted on one
server before the other server reconciles. This will cover the case
where the reconcile happens after the resource is deleted.

* Add a delete mananagement token function

Passes a function to the HCP manager that deletes the management token
that was initially created by the manager.

* Delete token as part of stopping the manager

* Lock around disabling config, remove descriptions
2024-01-30 09:40:36 -06:00
John Murret 7c6a3c83f2
NET-7165 - v2 - add service questions (#20390)
* NET-7165 - v2 - add service  questions

* removing extraneous copied over code from autogen PR script.

* fixing license checking
2024-01-29 22:33:45 +00:00
Melissa Kam 3b9bb8d6f9
[CC-7044] Start HCP manager as part of link creation (#20312)
* Check for ACL write permissions on write

Link eventually will be creating a token, so require acl:write.

* Convert Run to Start, only allow to start once

* Always initialize HCP components at startup

* Support for updating config and client

* Pass HCP manager to controller

* Start HCP manager in link resource

Start as part of link creation rather than always starting. Update
the HCP manager with values from the link before starting as well.

* Fix metrics sink leaked goroutine

* Remove the hardcoded disabled hostname prefix

The HCP metrics sink will always be enabled, so the length of sinks will
always be greater than zero. This also means that we will also always
default to prefixing metrics with the hostname, which is what our
documentation states is the expected behavior anyway.

* Add changelog

* Check and set running status in one method

* Check for primary datacenter, add back test

* Clarify merge reasoning, fix timing issue in test

* Add comment about controller placement

* Expand on breaking change, fix typo in changelog
2024-01-29 16:31:44 -06:00
Matt Keeler 34a32d4ce5
Remove V2 PeerName field from pbresource.Tenancy (#19865)
The peer name will eventually show up elsewhere in the resource. For now though this rips it out of where we don’t want it to be.
2024-01-29 15:08:31 -05:00
Dan Stough 0ca7313b07
feat(v2dns): add PTR query support (#20362) 2024-01-29 11:40:10 -05:00
Tyler Wendlandt 7e08d8988c
NET-5398: Update UI server to include if v2 is enabled (#20353)
* Update ui server to include V2 Catalog flag

* Fix typo
2024-01-26 14:38:51 -07:00
Nitya Dhanushkodi 0ec7bddb9a
[Net-5594][Net-7466] v2: Only route to endpoints that implement the port being routed to, and make xdscontroller and xdsv2 golden tests use tenancy (#20356)
* If a workload does not implement a port, it should not be included in the list of endpoints for the Envoy cluster for that port.

* Adds tenancy tests for xds controller and xdsv2 resource generation, and adds all those files.

* The original change in this PR was for filtering the list of endpoints by the port being routed to (bullet 1). Since I made changes to sidecarproxycontroller golden files, I realized some of the golden files were unused because of the tenancy changes, so when I deleted those, that broke xds controller tests which weren't correctly using tenancy. So when I fixed that, then the xdsv2 tests broke, so I added tenancy support there too. So now, from sidecarproxy controller -> xds controller -> xdsv2 we now have tenancy support and all the golden files are lined up.
2024-01-26 10:07:21 -08:00
sarahalsmiller 37ebaa6920
Net 7155- Consul API Gateway Controller Stub Work (#20324)
* API Gateway proto

* fix lint issue

* new line

* run make proto format

* checkpoint

* stub

* Update internal/mesh/internal/controllers/apigateways/controller.go
2024-01-25 23:16:20 +00:00
Luke Kysow 840f11a0c5
Change logging of registered v2 resource endpoints to add /api prefix (#20352)
* Change logging of registered v2 resource endpoints to add /api prefix

Previous:

    agent.http: Registered resource endpoint: endpoint=/demo/v1/executive

New:

    agent.http: Registered resource endpoint: endpoint=/api/demo/v1/executive

This reduces confusion when attempting to call the APIs after looking at
the logs.
2024-01-25 14:18:54 -08:00
Semir Patel efdf80413c
resource: add MutateAndValidate endpoint (#20311) 2024-01-25 13:12:30 -06:00
Dan Stough 6828780131
feat(v2dns): add partial support for SOA records (#20320) 2024-01-24 15:32:42 -05:00