nixos-servers/nix/flake/kubenix/inbucket.nix

74 lines
1.5 KiB
Nix

{
kubernetes.resources = {
deployments.inbucket = {
metadata.labels.app = "inbucket";
spec = {
selector.matchLabels.app = "inbucket";
template = {
metadata.labels.app = "inbucket";
spec = {
containers.inbucket = {
image = "inbucket/inbucket:edge";
# TODO: investigate the use of named ports.
ports = [
{
containerPort = 9000;
protocol = "TCP";
}
{
containerPort = 2500;
protocol = "TCP";
}
];
};
};
};
};
};
services = {
inbucket-web.spec = {
selector.app = "inbucket";
ports = [{
protocol = "TCP";
port = 80;
targetPort = 9000;
}];
};
inbucket-email.spec = {
type = "LoadBalancer";
loadBalancerIP = "192.168.30.130";
selector.app = "inbucket";
ports = [{
port = 25;
targetPort = 2500;
}];
};
};
ingresses.inbucket.spec = {
ingressClassName = "traefik";
rules = [{
host = "inbucket.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "inbucket-web";
port.number = 80;
};
}];
}];
};
};
}