nixos-servers/kubenix-modules/inbucket.nix

78 lines
1.6 KiB
Nix

{ myLib, ... }: {
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";
ports = {
web.containerPort = 9000;
smtp.containerPort = 2500;
};
};
};
};
};
};
services = {
inbucket-web.spec = {
selector.app = "inbucket";
ports.web = {
port = 80;
targetPort = "web";
};
};
inbucket-email.spec = {
type = "LoadBalancer";
loadBalancerIP = myLib.globals.inbucketIPv4;
selector.app = "inbucket";
ports = [{
port = 25;
targetPort = "smtp";
}];
};
};
ingresses.inbucket = {
metadata.annotations = {
"cert-manager.io/cluster-issuer" = "letsencrypt";
"traefik.ingress.kubernetes.io/router.entrypoints" = "localsecure";
};
spec = {
ingressClassName = "traefik";
rules = [{
host = "inbucket.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "inbucket-web";
port.name = "web";
};
}];
}];
tls = [{
secretName = "inbucket-tls";
hosts = [ "inbucket.kun.is" ];
}];
};
};
};
}