nixos-servers/kubenix-modules/nextcloud.nix

66 lines
1.4 KiB
Nix
Raw Normal View History

2024-03-28 20:44:21 +00:00
{
kubernetes.resources = {
2024-03-29 11:04:16 +00:00
configMaps.nextcloud.data = {
POSTGRES_USER = "nextcloud";
POSTGRES_DB = "nextcloud";
POSTGRES_HOST = "lewis.dmz";
};
2024-04-14 12:48:27 +00:00
secrets.nextcloud.stringData.databasePassword = "ref+sops://secrets/sops.yaml#/nextcloud/databasePassword";
2024-03-29 11:04:16 +00:00
deployments.nextcloud = {
metadata.labels.app = "nextcloud";
spec = {
selector.matchLabels.app = "nextcloud";
template = {
metadata.labels.app = "nextcloud";
spec = {
2024-04-14 19:00:15 +00:00
volumes.data.persistentVolumeClaim.claimName = "nextcloud";
2024-03-29 11:04:16 +00:00
containers.nextcloud = {
image = "nextcloud:27";
envFrom = [{ configMapRef.name = "nextcloud"; }];
2024-04-14 19:43:31 +00:00
ports.web.containerPort = 80;
2024-03-29 11:04:16 +00:00
2024-04-14 19:00:15 +00:00
env.POSTGRES_PASSWORD.valueFrom.secretKeyRef = {
name = "nextcloud";
key = "databasePassword";
};
2024-03-29 11:04:16 +00:00
volumeMounts = [{
name = "data";
mountPath = "/var/www/html";
}];
};
};
};
};
};
services.nextcloud.spec = {
selector.app = "nextcloud";
2024-04-14 19:43:31 +00:00
ports.web = {
2024-03-29 11:04:16 +00:00
port = 80;
2024-04-14 19:43:31 +00:00
targetPort = "web";
};
2024-03-29 11:04:16 +00:00
};
};
2024-03-29 11:04:16 +00:00
lab = {
nfsVolumes.nextcloud.path = "nextcloud/data";
ingresses.nextcloud = {
host = "cloud.kun.is";
service = {
name = "nextcloud";
portName = "web";
};
2024-03-29 11:04:16 +00:00
};
2024-03-28 20:44:21 +00:00
};
}