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

use consul connect to provide secure, load-balanced access to node socket internally #71

Open
nrdxp opened this issue Feb 28, 2023 · 0 comments

Comments

@nrdxp
Copy link
Contributor

nrdxp commented Feb 28, 2023

Currently any services that require access to a node socket need a dedicated cardano node running along side it, such as db-sync & ogmios. It might be more efficient and also more fault tolerant to provide a consul connect service that exposes the socket of every node in the network at the same address.

It would look something like this:

  1. node creates local unix socket
  2. socat (or similar tool) sidecar exposes the socket on a local port
  3. create a consul service to point at this port, all nodes use the same service name so they are pooled
  4. set a consul connect sidecar to expose a load-balanced proxy to this service
  5. any internal service that needs access to a socket (db-sync, etc) can read from this proxy to have HA access to the nodes in the network

So long as you don't expose the service to the outside world via traefik, it should be plenty secure and probably more robust, while also saving resource consumption of the additional companion nodes in the network.

There has also been some work in Nomad upstream to allow for a distinction between "liveness" and "readiness", so we could flesh this out further in the future by writing a "readiness" check for the node which ensures it isn't forked, etc before allowing it to be added to the Consul service pool.

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

No branches or pull requests

1 participant