Backport of Fix resolution of service resolvers with subsets for external upstreams into release/1.15.x#16525
Merged
hc-github-team-consul-core merged 4 commits intorelease/1.15.xfrom Mar 3, 2023
Conversation
e32a5d8 to
8d0c644
Compare
24f98cc to
5e225a0
Compare
github-team-consul-core-pr-approver
approved these changes
Mar 3, 2023
Collaborator
github-team-consul-core-pr-approver
left a comment
There was a problem hiding this comment.
Auto approved Consul Bot automated PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #16499 to be assessed for backporting due to the inclusion of the label backport/1.15.
The below text is copied from the body of the original PR.
Description
While fixing #16498 I noticed that applying a
ServiceResolverwith subsets wasn't functional when referencing an external service proxied through aTerminatingGatewayas an upstream. I'm not too familiar with the way we return service health for external services, but the problem appears to be that in our health check materializer we:CheckServiceNodevalues from our subscription, and thenSince we return the gateway associated with the service when we're using external services in conjuction with a
TerminatingGateway:consul/agent/consul/state/catalog.go
Lines 2770 to 2782 in 21c3095
The filter never passes and we are never able to resolve the upstream endpoint properly.
I'm not entirely sure whether this is the only change needed, but from what I could tell all of the health checks initiated via
proxycfggo through this code path since they leverage either the gRPC endpoints or a direct subscription to the in-memory store.Testing & Reproduction steps
Create a set of external services that has a
ServiceResolverwith subsets as in #16498 and a local service that leverages those services as an upstream. Hit the local proxy's admin cluster listing endpoint.Without the fix (no ip address ever associates with the endpoint):
With the fix (contains terminating gateway ip for its endpoint):
PR Checklist
Overview of commits