kubernetes-deployments/modules/radicale.nix

71 lines
1.4 KiB
Nix
Raw Normal View History

2024-10-28 15:05:06 +00:00
{
config,
2024-12-17 22:02:06 +00:00
utils,
2024-10-28 15:05:06 +00:00
lib,
globals,
...
}: {
2024-09-07 10:35:02 +00:00
options.radicale.enable = lib.mkEnableOption "radicale";
config = lib.mkIf config.radicale.enable {
kubernetes.resources = {
deployments.server.spec = {
selector.matchLabels.app = "radicale";
strategy = {
type = "RollingUpdate";
rollingUpdate = {
maxSurge = 0;
maxUnavailable = 1;
};
};
template = {
metadata.labels.app = "radicale";
spec = {
containers.radicale = {
2024-12-19 20:07:30 +00:00
image = utils.mkNixNGImage "radicale";
2024-09-07 10:35:02 +00:00
ports.web.containerPort = 5232;
imagePullPolicy = "IfNotPresent";
volumeMounts = [
{
name = "data";
mountPath = "/data";
}
];
};
2024-12-17 22:02:06 +00:00
volumes.data.persistentVolumeClaim.claimName = "data";
2024-09-07 10:35:02 +00:00
};
};
};
services.server.spec = {
type = "LoadBalancer";
loadBalancerIP = globals.radicaleIPv4;
selector.app = "radicale";
ports.web = {
port = 80;
targetPort = "web";
};
};
};
lab = {
tailscaleIngresses.tailscale = {
host = "radicale";
service.name = "server";
};
longhorn.persistentVolumeClaim.data = {
volumeName = "radicale";
storage = "200Mi";
};
};
};
}