Service Discovery with Praefect requires unrelated configuration changes
We recently added service discovery for Praefect. The documentation discusses the customer bringing their own DNS server, but the example included uses Consul as the DNS server.
A customer was on 15.11.7-ee and wanted to use Consul as the DNS server, as depicted in the examples. According to the code (link, link, link), service discovery requires that the following are all set:
-
consul
must be enabled -
praefect['consul_service_name'] = 'praefect'
should exist -
consul['monitoring_service_discovery']
must be enabled -
praefect['configuration']['prometheus_listen_addr']
is configured
While enabling consul
and consul_service_name
are okay, monitoring_service_discovery
and prometheus_listen_addr
shouldn't be required because they apply to monitoring. The customer had to add monitoring_service_discovery
to the Praefect nodes in order to register the praefect
service.
I created gitlab!136238 (merged) to update the documentation to reflect the steps customers have to take to use Consul right now.
The code should be refactored to account for the creation of a Praefect service in Consul without dealing with Prometheus configuration.