nixos-servers/kubenix-modules/nextcloud.nix

86 lines
2 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";
strategy = {
type = "RollingUpdate";
rollingUpdate = {
maxSurge = 0;
maxUnavailable = 1;
};
};
2024-03-29 11:04:16 +00:00
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 = {
2024-04-29 14:08:16 +00:00
image = "nextcloud:28";
2024-03-29 11:04:16 +00:00
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";
}];
};
2024-05-21 20:35:46 +00:00
securityContext = {
fsGroup = 33;
fsGroupChangePolicy = "OnRootMismatch";
};
affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution = [{
weight = 1;
preference.matchExpressions = [{
key = "storageType";
operator = "In";
values = [ "fast" ];
}];
}];
2024-03-29 11:04:16 +00:00
};
};
};
};
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 = {
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
};
}