cluster/services/patroni: register with consul

This commit is contained in:
Max Headroom 2023-03-06 00:27:29 +01:00
parent 363c54b0f6
commit baf8fe481e

View file

@ -72,4 +72,17 @@ in
};
environmentFiles = lib.mapAttrs (n: _: config.age.secrets.${n}.path) vars.patroni.passwords;
};
consul.services.patroni = {
mode = "external";
definition.service = rec {
name = "patroni";
address = getMeshIp vars.hostName;
port = cluster.config.links.patroni-pg-internal.port;
checks = lib.singleton {
interval = "5s";
http = "http://${address}:${cluster.config.links.patroni-api.portStr}";
};
};
};
}