Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Support routing to Consul services imported from a peer #406

Merged
merged 14 commits into from
Nov 22, 2022
Merged

Conversation

nathancoleman
Copy link
Member

@nathancoleman nathancoleman commented Oct 11, 2022

Changes proposed in this PR:

  • Add peer to the MeshService CRD enabling users to target a Consul service imported from a peering connection
  • Use peering endpoint instead of local catalog to resolve route backends that specify a peer

How I've tested this PR:

  • Follow Cluster Peering on Kubernetes guide
  • Install services into one datacenter and export one or all of them to the other datacenter (the local track of this guide is handy)
  • In the other datacenter (the one not containing the services), create a Gateway and HTTPRoute with a MeshService backend referencing one of the services imported from the other datacenter
  • Verify that you can reach the imported service through the Gateway

How I expect reviewers to test this PR:

See above

Checklist:

  • Tests added
  • CHANGELOG entry added

    Run make changelog-entry for guidance in authoring a changelog entry, and
    commit the resulting file, which should have a name matching your PR number.
    Entries should use imperative present tense (e.g. Add support for...)

@nathancoleman nathancoleman added the pr/no-changelog Skip the CI check that requires a changelog entry label Oct 11, 2022
@nathancoleman nathancoleman self-assigned this Oct 11, 2022
@nathancoleman nathancoleman force-pushed the peering branch 3 times, most recently from 26628e2 to 9951811 Compare October 17, 2022 19:39
@nathancoleman nathancoleman removed the pr/no-changelog Skip the CI check that requires a changelog entry label Oct 17, 2022
@nathancoleman nathancoleman marked this pull request as ready for review November 1, 2022 20:55
@nathancoleman nathancoleman force-pushed the peering branch 2 times, most recently from 1b93176 to 9d53165 Compare November 17, 2022 04:53
@@ -1,14 +1,18 @@
package testing
package consul
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to move this file from testing to avoid circular imports

Copy link
Contributor

@andrewstucki andrewstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall LGTM

@nathancoleman nathancoleman added the pr/conformance Run conformance tests from kubernetes-sigs/gateway-api label Nov 21, 2022
@nathancoleman
Copy link
Member Author

Confirmed this works with consul 1.14 and consul-k8s 1.0.0

@nathancoleman nathancoleman merged commit 3fa4a6f into main Nov 22, 2022
@nathancoleman nathancoleman deleted the peering branch November 22, 2022 00:57
andrewstucki pushed a commit that referenced this pull request Nov 22, 2022
* Stub func for finding service imported from peer

* Add peerName to MeshService CRD, fork service lookup when specified

* Use "Peer" instead of "PeerName" for consistency

* Add changelog entry

* Return Consul resolution error when no matching service name from peer

* Add unit test coverage for resolving of imported service from peer

* Remove unnecessary mock generation target

* go mod tidy

* Consume latest tag of consul/api containing dependencies

* Resolve dependency issues from merge

* Add Peerings to Consul client interface

* Adjust testing strategy to account for hot swap of Consul client
andrewstucki pushed a commit that referenced this pull request Nov 22, 2022
* Stub func for finding service imported from peer

* Add peerName to MeshService CRD, fork service lookup when specified

* Use "Peer" instead of "PeerName" for consistency

* Add changelog entry

* Return Consul resolution error when no matching service name from peer

* Add unit test coverage for resolving of imported service from peer

* Remove unnecessary mock generation target

* go mod tidy

* Consume latest tag of consul/api containing dependencies

* Resolve dependency issues from merge

* Add Peerings to Consul client interface

* Adjust testing strategy to account for hot swap of Consul client
andrewstucki pushed a commit that referenced this pull request Nov 22, 2022
…nto release/0.5.x (#465)

* Support routing to Consul services imported from a peer (#406)

* Stub func for finding service imported from peer

* Add peerName to MeshService CRD, fork service lookup when specified

* Use "Peer" instead of "PeerName" for consistency

* Add changelog entry

* Return Consul resolution error when no matching service name from peer

* Add unit test coverage for resolving of imported service from peer

* Remove unnecessary mock generation target

* go mod tidy

* Consume latest tag of consul/api containing dependencies

* Resolve dependency issues from merge

* Add Peerings to Consul client interface

* Adjust testing strategy to account for hot swap of Consul client

* Update changelog

Co-authored-by: Nathan Coleman <[email protected]>
Co-authored-by: Andrew Stucki <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/0.5.x pr/conformance Run conformance tests from kubernetes-sigs/gateway-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants