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

[feature] Allow discovery to check against existing services in Consul #1096

Open
gpaggi opened this issue Apr 15, 2016 · 5 comments
Open

[feature] Allow discovery to check against existing services in Consul #1096

gpaggi opened this issue Apr 15, 2016 · 5 comments

Comments

@gpaggi
Copy link

gpaggi commented Apr 15, 2016

All of our services already register in Consul, together with their health check (script), for service discovery.
I'm looking into deploying them with Nomad but run into an issue with the discovery implementation.

It would be great to be able to configure Nomad, in the service key, to not register the service in Consul and check against an existing health check in Consul. Something like:

service {
  register = false
  check {
     type = "consul"
     serviceId = "mock-test-${NOMAD_ADDR_http}'
  }
}

I'm sure there are other people already using Consul for service discovery who would end up with registering services twice if they were using the current Nomad integration with Consul...

@gpaggi gpaggi changed the title [feature] Allow discovery to check against existing services / health checks in Consul [feature] Allow discovery to check against existing services in Consul Apr 15, 2016
@dadgar
Copy link
Contributor

dadgar commented Apr 15, 2016

If your applications are already registering with Consul, then can you not just omit the service block from Nomad?

@gpaggi
Copy link
Author

gpaggi commented Apr 15, 2016

If I do, how is it Nomad going to determine the health of the service? From what I've seen, if I omit the service block, Nomad will only monitor the PID of the service, with no knowledge about its actual health.

@dvusboy
Copy link

dvusboy commented Apr 15, 2016

@dadgar: Put it another way, consul is not meant to take action on the outcome of these checks, but nomad is.

@dadgar
Copy link
Contributor

dadgar commented Apr 18, 2016

Currently Nomad registers and deregisters the service/checks but does not use that information while scheduling. Down the line there will be deeper integration (only do a rolling upgrade when the app is healthy, etc). But I understand your ask. I will mark it as an improvement but until we have deeper integrations the net effect can be reached by not having the service block defined in your job.

@gpaggi
Copy link
Author

gpaggi commented Apr 19, 2016

@dadgar Thanks. I was under the impression that Nomad would leverage Consul for health checking after registering the services, but I understand now that's not the case; I'll skip defining the service block in my jobs for now.
I see #876 is open for something similar, albeit for the Docker driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants