csmith / centauri

TLS-terminating reverse proxy in Go
MIT License
1 stars 1 forks source link

Share certificates across multiple Centauri instances #16

Open ShaneMcC opened 2 years ago

ShaneMcC commented 2 years ago

I want to run Centauri in Docker Swarm with an instance per node (as a global service), they will all share the same config (and probably the same mounted copy of certs.json)

In this case I don't want each instance to all attempt to generate certificates and it would be nice if they all shared them.

Ways I can think to do this:

  1. Stick with certs.json
    1. Lock certs.json when doing certificate generation, then only a single instance can actually do it at a time
    2. notify watch the file to see when it changes and reload the certificates when it does (so the nodes that couldn't lock it still get the certs afterwards)
  2. Store certs in something like redis (Though then redis becomes a bit of a SPOF unless clustered)