split paperless-ngx into multiple deployments

fix forgotten paperless data mount
This commit is contained in:
Pim Kunis 2024-04-03 22:16:21 +02:00
parent 18601e30b6
commit d858f88681

View file

@ -1,7 +1,7 @@
{
kubernetes.resources = {
configMaps.paperless-ngx.data = {
PAPERLESS_REDIS = "redis://localhost:6379";
PAPERLESS_REDIS = "redis://paperless-ngx-redis.default.svc.cluster.local:6379";
PAPERLESS_DBENGINE = "postgresql";
PAPERLESS_DBHOST = "lewis.dmz";
PAPERLESS_DBNAME = "paperless";
@ -21,27 +21,27 @@
secretKey = "ref+file:///home/pim/.config/home/vals.yaml#/paperless-ngx/secretKey";
};
deployments.paperless-ngx = {
metadata.labels.app = "paperless-ngx";
spec = {
selector.matchLabels.app = "paperless-ngx";
template = {
metadata.labels.app = "paperless-ngx";
spec = {
containers = {
redis = {
image = "docker.io/library/redis:7";
volumeMounts = [{
name = "redisdata";
mountPath = "/data";
}];
deployments = {
paperless-ngx-web = {
metadata.labels = {
app = "paperless-ngx";
component = "web";
};
paperless-ngx = {
spec = {
selector.matchLabels = {
app = "paperless-ngx";
component = "web";
};
template = {
metadata.labels = {
app = "paperless-ngx";
component = "web";
};
spec = {
containers.paperless-ngx = {
image = "ghcr.io/paperless-ngx/paperless-ngx:2.3";
envFrom = [{ configMapRef.name = "paperless-ngx"; }];
@ -68,17 +68,64 @@
};
}
];
};
volumeMounts = [{
name = "data";
mountPath = "/data";
}];
};
volumes = [{
name = "redisdata";
name = "data";
persistentVolumeClaim.claimName = "paperless-ngx-data";
}];
};
};
};
};
paperless-ngx-redis = {
metadata.labels = {
app = "paperless-ngx";
component = "redis";
};
spec = {
selector.matchLabels = {
app = "paperless-ngx";
component = "redis";
};
template = {
metadata.labels = {
app = "paperless-ngx";
component = "redis";
};
spec = {
containers.redis = {
image = "docker.io/library/redis:7";
ports = [{
containerPort = 6379;
protocol = "TCP";
}];
volumeMounts = [{
name = "data";
mountPath = "/data";
}];
};
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "paperless-ngx-redisdata";
}];
};
};
};
};
};
persistentVolumes = {
paperless-ngx-redisdata.spec = {
@ -110,7 +157,7 @@
volumeName = "paperless-ngx-redisdata";
};
paperless-data.spec = {
paperless-ngx-data.spec = {
accessModes = [ "ReadWriteMany" ];
storageClassName = "";
resources.requests.storage = "1Mi";
@ -118,8 +165,12 @@
};
};
services.paperless-ngx.spec = {
selector.app = "paperless-ngx";
services = {
paperless-ngx-web.spec = {
selector = {
app = "paperless-ngx";
component = "web";
};
ports = [{
protocol = "TCP";
@ -128,6 +179,20 @@
}];
};
paperless-ngx-redis.spec = {
selector = {
app = "paperless-ngx";
component = "redis";
};
ports = [{
protocol = "TCP";
port = 6379;
targetPort = 6379;
}];
};
};
ingresses.paperless-ngx.spec = {
ingressClassName = "traefik";
@ -139,7 +204,7 @@
pathType = "Prefix";
backend.service = {
name = "paperless-ngx";
name = "paperless-ngx-web";
port.number = 80;
};
}];