kubernetes-deployments/modules/inbucket.nix

73 lines
1.4 KiB
Nix
Raw Normal View History

2024-10-28 15:05:06 +00:00
{
globals,
config,
lib,
...
}: {
2024-09-07 10:35:02 +00:00
options.inbucket.enable = lib.mkEnableOption "inbucket";
config = lib.mkIf config.inbucket.enable {
kubernetes.resources = {
2024-10-28 15:05:06 +00:00
serviceAccounts.inbucket = {};
2024-09-07 10:35:02 +00:00
deployments.inbucket.spec = {
selector.matchLabels.app = "inbucket";
template = {
metadata.labels.app = "inbucket";
spec = {
serviceAccountName = "inbucket";
containers.inbucket = {
image = globals.images.inbucket;
ports = {
web.containerPort = 9000;
smtp.containerPort = 2500;
};
};
};
};
};
services = {
inbucket.spec = {
loadBalancerIP = globals.inbucketIPv4;
type = "LoadBalancer";
selector.app = "inbucket";
ports = {
smtp = {
port = 25;
targetPort = "smtp";
};
web = {
port = 80;
targetPort = "web";
};
};
};
};
};
lab = {
tailscaleIngresses.tailscale = {
host = "inbucket";
service.name = "inbucket";
};
ingresses.inbucket = {
host = "inbucket.kun.is";
entrypoint = "localsecure";
service = {
name = "inbucket";
portName = "web";
};
};
};
};
}