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