nixos-servers/kubenix-modules/nextcloud.nix

109 lines
2.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";
};
secrets.nextcloud.stringData.databasePassword = "ref+file:///home/pim/.config/home/vals.yaml#/nextcloud/databasePassword";
deployments.nextcloud = {
metadata.labels.app = "nextcloud";
spec = {
selector.matchLabels.app = "nextcloud";
template = {
metadata.labels.app = "nextcloud";
spec = {
containers.nextcloud = {
image = "nextcloud:27";
envFrom = [{ configMapRef.name = "nextcloud"; }];
ports = [{
containerPort = 80;
protocol = "TCP";
}];
env = [{
name = "POSTGRES_PASSWORD";
valueFrom.secretKeyRef = {
name = "nextcloud";
key = "databasePassword";
};
}];
volumeMounts = [{
name = "data";
mountPath = "/var/www/html";
}];
};
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "nextcloud";
}];
};
};
};
};
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
};
}