nixos-servers/kubenix-modules/inbucket.nix

61 lines
1.3 KiB
Nix
Raw Normal View History

{ myLib, ... }: {
kubernetes.resources = {
serviceAccounts.inbucket = { };
2024-07-21 13:05:27 +00:00
deployments.inbucket.spec = {
selector.matchLabels.app = "inbucket";
template = {
metadata.labels.app = "inbucket";
spec = {
serviceAccountName = "inbucket";
2024-07-21 13:05:27 +00:00
containers = {
inbucket = {
image = "inbucket/inbucket:edge";
env.INBUCKET_WEB_ADDR.value = "0.0.0.0:80";
2024-07-21 13:05:27 +00:00
ports = {
web.containerPort = 80;
smtp.containerPort = 2500;
};
};
};
};
};
};
services = {
web.spec = {
2024-07-21 13:05:27 +00:00
type = "LoadBalancer";
loadBalancerIP = myLib.globals.inbucketWebIPv4;
selector.app = "inbucket";
2024-04-14 19:43:31 +00:00
ports.web = {
port = 80;
2024-04-14 19:43:31 +00:00
targetPort = "web";
};
};
email.spec = {
type = "LoadBalancer";
2024-07-21 13:05:27 +00:00
loadBalancerIP = myLib.globals.inbucketEmailIPv4;
selector.app = "inbucket";
ports = [{
port = 25;
2024-04-14 19:43:31 +00:00
targetPort = "smtp";
}];
};
};
};
lab.tailscale = {
enable = true;
allowedServiceAccounts = [ "inbucket" ];
deploymentsWithSidecarContainers.inbucket.hostName = "inbucket";
};
}