nixos-servers/kubenix-modules/nextcloud.nix

102 lines
2.3 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"; }];
ports = [{
containerPort = 80;
protocol = "TCP";
}];
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-03-28 20:44:21 +00:00
persistentVolumes.nextcloud.spec = {
capacity.storage = "1Mi";
accessModes = [ "ReadWriteMany" ];
nfs = {
2024-04-12 21:31:10 +00:00
server = "lewis.dmz";
2024-03-28 20:44:21 +00:00
path = "/mnt/data/nfs/nextcloud/data";
};
};
persistentVolumeClaims.nextcloud.spec = {
accessModes = [ "ReadWriteMany" ];
storageClassName = "";
resources.requests.storage = "1Mi";
volumeName = "nextcloud";
};
2024-03-29 11:04:16 +00:00
services.nextcloud.spec = {
selector.app = "nextcloud";
ports = [{
protocol = "TCP";
port = 80;
targetPort = 80;
}];
};
ingresses.nextcloud = {
metadata.annotations."cert-manager.io/cluster-issuer" = "letsencrypt";
2024-03-29 11:04:16 +00:00
spec = {
ingressClassName = "traefik";
2024-03-29 11:04:16 +00:00
rules = [{
host = "cloud.kun.is";
2024-03-29 11:04:16 +00:00
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "nextcloud";
port.number = 80;
};
}];
2024-03-29 11:04:16 +00:00
}];
tls = [{
secretName = "nextcloud-tls";
hosts = [ "cloud.kun.is" ];
}];
};
2024-03-29 11:04:16 +00:00
};
2024-03-28 20:44:21 +00:00
};
}