cluster/services/patroni: register with consul
This commit is contained in:
parent
363c54b0f6
commit
baf8fe481e
1 changed files with 13 additions and 0 deletions
|
@ -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}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue