cluster/services/websites: register with consul

This commit is contained in:
Max Headroom 2023-03-06 00:36:17 +01:00
parent baf8fe481e
commit 63b9957926

View file

@ -1,4 +1,4 @@
{ inputs, lib, pkgs, tools, ... }:
{ config, inputs, lib, pkgs, tools, ... }:
let
importWebsites = expr: import expr {
@ -20,4 +20,17 @@ let
in {
services.nginx.virtualHosts = websites;
security.acme.certs = lib.mapAttrs' acmeUseDNS (lib.filterAttrs isACME websites);
consul.services.nginx = {
mode = "external";
definition.service = {
name = "static-lb";
address = lib.toLower "${config.networking.hostName}.${config.networking.domain}";
port = 443;
checks = lib.singleton {
interval = "60s";
tcp = "127.0.0.1:80";
};
};
};
}