kubernetes-deployments/modules/ntfy.nix

63 lines
1.2 KiB
Nix

{
lib,
config,
utils,
...
}: {
options.ntfy.enable = lib.mkEnableOption "ntfy";
config = lib.mkIf config.ntfy.enable {
kubernetes.resources = {
deployments.ntfy.spec = {
selector.matchLabels.app = "ntfy";
strategy.type = "Recreate";
template = {
metadata.labels.app = "ntfy";
spec = {
nodeName = "jefke";
containers.ntfy = {
image = utils.mkNixNGImage "ntfy";
ports.web.containerPort = 80;
env.TZ.value = "Europe/Amsterdam";
volumeMounts = [
{
name = "data";
mountPath = "/var/lib/ntfy";
}
];
};
volumes.data.hostPath = {
path = "/mnt/longhorn/persistent/volumes/ntfy";
type = "Directory";
};
};
};
};
services.ntfy.spec = {
selector.app = "ntfy";
ports.web = {
port = 80;
targetPort = "web";
};
};
};
lab = {
ingresses.ntfy = {
host = "ntfy.kun.is";
service = {
name = "ntfy";
portName = "web";
};
};
};
};
}