Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service discovery: add RPC endpoints and FSM logic #12171

Merged
merged 5 commits into from
Mar 4, 2022

Conversation

jrasell
Copy link
Member

@jrasell jrasell commented Mar 2, 2022

This PR adds the RPC logic for service discovery. This includes a new endpoint as well as updates to the alloc and job endpoints to provide easy lookup of registrations associated to these objects.

The new ServiceRegistration endpoint is static/dynamic to ensure the Upsert RPC, which is only callable via client agent, includes TLS verification. It also includes functionality for wildcard listing as is common across all list endpoint within Nomad.

The ipaddr package mirrors Consul and ensure no service is registered which has an any IP address and therefore is not logically routable outside its local instance.

Apologies for the size, although I believe at least 60% of the additions are tests. The PR is split into commits which group the additions into logical chunks and hope to make it easier to review.

closes https://github.com/hashicorp/team-nomad/issues/259

@jrasell jrasell added this to the 1.3.0 milestone Mar 2, 2022
@jrasell jrasell self-assigned this Mar 2, 2022
@jrasell jrasell requested a review from schmichael March 2, 2022 09:27
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM. I've left one question/comment about TLS cert checking that we should look at, but other than that this is really solid.

nomad/server.go Show resolved Hide resolved
nomad/service_registration_endpoint.go Show resolved Hide resolved
nomad/structs/alloc.go Show resolved Hide resolved
nomad/structs/service_registration.go Show resolved Hide resolved
helper/ipaddr/ipaddr.go Outdated Show resolved Hide resolved
nomad/service_registration_endpoint.go Show resolved Hide resolved
nomad/server.go Outdated Show resolved Hide resolved
nomad/structs/service_registration.go Outdated Show resolved Hide resolved
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants