nixos-servers/kubenix-modules/radicale.nix

114 lines
2.3 KiB
Nix
Raw Normal View History

2024-05-09 19:03:27 +00:00
{ lib, ... }: {
2024-03-28 20:10:15 +00:00
kubernetes.resources = {
configMaps.server.data = {
2024-03-28 20:10:15 +00:00
users = "pim:$apr1$GUiTihkS$dDCkaUxFx/O86m6NCy/yQ.";
2024-05-09 19:03:27 +00:00
config = lib.generators.toINI { } {
server = {
hosts = "0.0.0.0:5232, [::]:5232";
ssl = false;
};
encoding = {
request = "utf-8";
stock = "utf-8";
};
auth = {
realm = "Radicale - Password Required";
type = "htpasswd";
htpasswd_filename = "/config/users";
htpasswd_encryption = "md5";
};
rights.type = "owner_only";
storage = {
type = "multifilesystem";
filesystem_folder = "/data";
};
logging = { };
headers = { };
};
2024-03-28 20:10:15 +00:00
};
deployments.server.spec = {
selector.matchLabels.app = "radicale";
2024-03-28 20:10:15 +00:00
strategy = {
type = "RollingUpdate";
2024-03-28 20:10:15 +00:00
rollingUpdate = {
maxSurge = 0;
maxUnavailable = 1;
};
};
2024-07-12 11:37:16 +00:00
template = {
metadata.labels.app = "radicale";
spec = {
containers.radicale = {
image = "tomsquest/docker-radicale:3.2.2.0";
ports.web.containerPort = 5232;
imagePullPolicy = "Always";
volumeMounts = [
{
name = "data";
mountPath = "/data";
}
{
name = "config";
mountPath = "/config/config";
subPath = "config";
}
{
name = "config";
mountPath = "/config/users";
subPath = "users";
}
];
2024-07-12 11:37:16 +00:00
};
volumes = {
data.persistentVolumeClaim.claimName = "data";
config.configMap.name = "server";
};
securityContext = {
fsGroup = 2999;
fsGroupChangePolicy = "OnRootMismatch";
2024-03-28 20:10:15 +00:00
};
};
};
};
services.server.spec = {
2024-03-28 20:10:15 +00:00
selector.app = "radicale";
2024-04-14 19:43:31 +00:00
ports.web = {
2024-03-28 20:10:15 +00:00
port = 80;
2024-04-14 19:43:31 +00:00
targetPort = "web";
};
2024-03-28 20:10:15 +00:00
};
};
2024-03-28 20:10:15 +00:00
lab = {
ingresses.web = {
host = "dav.kun.is";
service = {
name = "server";
portName = "web";
};
2024-03-28 20:10:15 +00:00
};
longhorn.persistentVolumeClaim.data = {
volumeName = "radicale";
storage = "200Mi";
};
2024-03-28 20:10:15 +00:00
};
}