nixos-servers/kubenix-modules/inbucket.nix
Pim Kunis a21a09ad6b Install longhorn on k3s
Introduce new storage standard with LVM
2024-05-18 23:32:58 +02:00

71 lines
1.5 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;
};
volumeMounts = [{
name = "storage";
mountPath = "/storage";
}];
};
volumes.storage.persistentVolumeClaim.claimName = "inbucket";
};
};
};
};
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";
}];
};
};
persistentVolumeClaims.inbucket.spec = {
accessModes = [ "ReadWriteOnce" ];
storageClassName = "longhorn";
resources.requests.storage = "30Mi";
};
};
lab.ingresses.inbucket = {
host = "inbucket.kun.is";
entrypoint = "localsecure";
service = {
name = "inbucket-web";
portName = "web";
};
};
}