Configure external nodes and services

We have a bunch of external nodes and services that should be integrated into consul.
As I understand I can add them with the consul api /catalog/service/ with "external-node": "true" and check them with consul-esm.

Is there a way to setup all the external nodes/services on startup of consul agent (server/client?) as with internal services with config files in config.d directory?

Should there be used an extra server or the consul-servers that starts some scripts to add them with curl to the catalog?

Or adding them with ExecStartPre= or ExecStartPost= command in systemd.service for consul-server or consul-esm or …?

Or …

What is your best practice for setting this up?

Thanks in advance.

Reini

Hi Reini!

Not sure if you have found these on your own, but we do have documentation that talks about deploying external services which could be useful in your endeavor:

Best,

Chip

Hi reini-1,

Some more details in addition to the documentation: currently there is no way to set-up external nodes on consul start up via config files. This is however something we are working on as part of https://github.com/hashicorp/consul-esm/issues/42 so that script checks can be supported and loaded via config files.

In the meantime, we recommend that the external nodes/services register themselves with the consul agent. If that’s not possible, a script on a separate server or from a systemd command works fine so long as the consul agent is already started up. Another option could be to use terraform which would allow you to set up external nodes/services in a codified way.

Hope that helps!

1 Like