nixos-servers/kubenix-modules/radicale.nix

99 lines
2 KiB
Nix
Raw Normal View History

2024-03-28 20:10:15 +00:00
{
kubernetes.resources = {
configMaps.radicale.data = {
users = "pim:$apr1$GUiTihkS$dDCkaUxFx/O86m6NCy/yQ.";
# TODO: Can this be generated with nix?
config = ''
[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]
'';
};
deployments.radicale = {
metadata.labels.app = "radicale";
spec = {
selector.matchLabels.app = "radicale";
template = {
metadata.labels.app = "radicale";
spec = {
containers.radicale = {
image = "tomsquest/docker-radicale";
2024-04-14 19:43:31 +00:00
ports.web.containerPort = 5232;
2024-03-28 20:10:15 +00:00
volumeMounts = [
{
name = "data";
mountPath = "/data";
}
{
name = "config";
mountPath = "/config/config";
subPath = "config";
}
{
name = "config";
mountPath = "/config/users";
subPath = "users";
}
];
};
2024-04-14 19:00:15 +00:00
volumes = {
data.persistentVolumeClaim.claimName = "radicale";
config.configMap.name = "radicale";
};
2024-03-28 20:10:15 +00:00
};
};
};
};
services.radicale.spec = {
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 = {
nfsVolumes.radicale.path = "radicale";
ingresses.radicale = {
host = "dav.kun.is";
service = {
name = "radicale";
portName = "web";
};
2024-03-28 20:10:15 +00:00
};
};
}