simplify kubenix definitions

This commit is contained in:
Pim Kunis 2024-04-14 21:00:15 +02:00
parent db0303f4d8
commit ec201a038d
12 changed files with 95 additions and 215 deletions

View file

@ -41,10 +41,7 @@
}]; }];
}; };
volumes = [{ volumes.config.configMap.name = "dnsmasq-config";
name = "config";
configMap.name = "dnsmasq-config";
}];
}; };
}; };
}; };

View file

@ -155,16 +155,10 @@
]; ];
}; };
volumes = [ volumes = {
{ data.persistentVolumeClaim.claimName = "forgejo";
name = "data"; config.configMap.name = "forgejo-config";
persistentVolumeClaim.claimName = "forgejo"; };
}
{
name = "config";
configMap.name = "forgejo-config";
}
];
}; };
}; };
}; };

View file

@ -19,6 +19,8 @@
metadata.labels.app = "freshrss"; metadata.labels.app = "freshrss";
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "freshrss";
containers.freshrss = { containers.freshrss = {
image = "freshrss/freshrss:edge"; image = "freshrss/freshrss:edge";
envFrom = [{ configMapRef.name = "freshrss"; }]; envFrom = [{ configMapRef.name = "freshrss"; }];
@ -28,35 +30,23 @@
protocol = "TCP"; protocol = "TCP";
}]; }];
env = [ env = {
{ ADMIN_PASSWORD.valueFrom.secretKeyRef = {
name = "ADMIN_PASSWORD"; name = "freshrss";
key = "adminPassword";
};
valueFrom.secretKeyRef = { ADMIN_API_PASSWORD.valueFrom.secretKeyRef = {
name = "freshrss"; name = "freshrss";
key = "adminPassword"; key = "adminPassword";
}; };
} };
{
name = "ADMIN_API_PASSWORD";
valueFrom.secretKeyRef = {
name = "freshrss";
key = "adminPassword";
};
}
];
volumeMounts = [{ volumeMounts = [{
name = "data"; name = "data";
mountPath = "/var/www/FreshRSS/data"; mountPath = "/var/www/FreshRSS/data";
}]; }];
}; };
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "freshrss";
}];
}; };
}; };
}; };

View file

@ -43,24 +43,17 @@
protocol = "TCP"; protocol = "TCP";
}]; }];
env = [ env = {
{ CMD_DB_URL.valueFrom.secretKeyRef = {
name = "CMD_DB_URL"; name = "hedgedoc";
key = "databaseURL";
};
valueFrom.secretKeyRef = { CMD_SESSION_SECRET.valueFrom.secretKeyRef = {
name = "hedgedoc"; name = "hedgedoc";
key = "databaseURL"; key = "sessionSecret";
}; };
} };
{
name = "CMD_SESSION_SECRET";
valueFrom.secretKeyRef = {
name = "hedgedoc";
key = "sessionSecret";
};
}
];
volumeMounts = [ volumeMounts = [
{ {
@ -75,16 +68,10 @@
]; ];
}; };
volumes = [ volumes = {
{ uploads.persistentVolumeClaim.claimName = "hedgedoc";
name = "uploads"; config.configMap.name = "hedgedoc-config";
persistentVolumeClaim.claimName = "hedgedoc"; };
}
{
name = "config";
configMap.name = "hedgedoc-config";
}
];
}; };
}; };
}; };

View file

@ -59,6 +59,8 @@
}; };
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "kitchenowl";
containers.kitchenowl-backend = { containers.kitchenowl-backend = {
image = "tombursch/kitchenowl:v92"; image = "tombursch/kitchenowl:v92";
@ -72,11 +74,6 @@
mountPath = "/data"; mountPath = "/data";
}]; }];
}; };
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "kitchenowl";
}];
}; };
}; };
}; };

View file

@ -79,16 +79,10 @@
]; ];
}; };
volumes = [ volumes = {
{ config.persistentVolumeClaim.claimName = "jellyfin-config";
name = "config"; media.persistentVolumeClaim.claimName = "media";
persistentVolumeClaim.claimName = "jellyfin-config"; };
}
{
name = "media";
persistentVolumeClaim.claimName = "media";
}
];
}; };
}; };
}; };
@ -122,8 +116,6 @@
containerPort = 9091; containerPort = 9091;
protocol = "TCP"; protocol = "TCP";
} }
# TODO: Only use TCP, as Kubernetes does not support multiple protocols for a port number.
# Should see if this works as correctly though.
{ {
containerPort = 31780; containerPort = 31780;
protocol = "TCP"; protocol = "TCP";
@ -142,16 +134,10 @@
]; ];
}; };
volumes = [ volumes = {
{ config.persistentVolumeClaim.claimName = "transmission-config";
name = "config"; media.persistentVolumeClaim.claimName = "media";
persistentVolumeClaim.claimName = "transmission-config"; };
}
{
name = "media";
persistentVolumeClaim.claimName = "media";
}
];
}; };
}; };
}; };
@ -176,6 +162,8 @@
}; };
spec = { spec = {
volumes.config.persistentVolumeClaim.claimName = "jellyseerr-config";
containers.jellyseerr = { containers.jellyseerr = {
image = "fallenbagel/jellyseerr:1.7.0"; image = "fallenbagel/jellyseerr:1.7.0";
envFrom = [{ configMapRef.name = "jellyseerr-env"; }]; envFrom = [{ configMapRef.name = "jellyseerr-env"; }];
@ -190,11 +178,6 @@
mountPath = "/app/config"; mountPath = "/app/config";
}]; }];
}; };
volumes = [{
name = "config";
persistentVolumeClaim.claimName = "jellyseerr-config";
}];
}; };
}; };
}; };
@ -240,16 +223,10 @@
]; ];
}; };
volumes = [ volumes = {
{ config.persistentVolumeClaim.claimName = "radarr-config";
name = "config"; media.persistentVolumeClaim.claimName = "media";
persistentVolumeClaim.claimName = "radarr-config"; };
}
{
name = "media";
persistentVolumeClaim.claimName = "media";
}
];
}; };
}; };
}; };
@ -274,6 +251,8 @@
}; };
spec = { spec = {
volumes.config.persistentVolumeClaim.claimName = "prowlarr-config";
containers.prowlarr = { containers.prowlarr = {
image = "lscr.io/linuxserver/prowlarr:latest"; image = "lscr.io/linuxserver/prowlarr:latest";
envFrom = [{ configMapRef.name = "prowlarr-env"; }]; envFrom = [{ configMapRef.name = "prowlarr-env"; }];
@ -288,11 +267,6 @@
mountPath = "/config"; mountPath = "/config";
}]; }];
}; };
volumes = [{
name = "config";
persistentVolumeClaim.claimName = "prowlarr-config";
}];
}; };
}; };
}; };
@ -338,16 +312,10 @@
]; ];
}; };
volumes = [ volumes = {
{ config.persistentVolumeClaim.claimName = "sonarr-config";
name = "config"; media.persistentVolumeClaim.claimName = "media";
persistentVolumeClaim.claimName = "sonarr-config"; };
}
{
name = "media";
persistentVolumeClaim.claimName = "media";
}
];
}; };
}; };
}; };
@ -393,16 +361,10 @@
]; ];
}; };
volumes = [ volumes = {
{ config.persistentVolumeClaim.claimName = "bazarr-config";
name = "config"; media.persistentVolumeClaim.claimName = "media";
persistentVolumeClaim.claimName = "bazarr-config"; };
}
{
name = "media";
persistentVolumeClaim.claimName = "media";
}
];
}; };
}; };
}; };

View file

@ -12,6 +12,8 @@
metadata.labels.app = "minecraft"; metadata.labels.app = "minecraft";
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "minecraft";
containers.minecraft = { containers.minecraft = {
image = "itzg/minecraft-server"; image = "itzg/minecraft-server";
envFrom = [{ configMapRef.name = "minecraft-env"; }]; envFrom = [{ configMapRef.name = "minecraft-env"; }];
@ -26,11 +28,6 @@
mountPath = "/data"; mountPath = "/data";
}]; }];
}; };
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "minecraft";
}];
}; };
}; };
}; };

View file

@ -18,6 +18,8 @@
metadata.labels.app = "nextcloud"; metadata.labels.app = "nextcloud";
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "nextcloud";
containers.nextcloud = { containers.nextcloud = {
image = "nextcloud:27"; image = "nextcloud:27";
envFrom = [{ configMapRef.name = "nextcloud"; }]; envFrom = [{ configMapRef.name = "nextcloud"; }];
@ -27,25 +29,16 @@
protocol = "TCP"; protocol = "TCP";
}]; }];
env = [{ env.POSTGRES_PASSWORD.valueFrom.secretKeyRef = {
name = "POSTGRES_PASSWORD"; name = "nextcloud";
key = "databasePassword";
valueFrom.secretKeyRef = { };
name = "nextcloud";
key = "databasePassword";
};
}];
volumeMounts = [{ volumeMounts = [{
name = "data"; name = "data";
mountPath = "/var/www/html"; mountPath = "/var/www/html";
}]; }];
}; };
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "nextcloud";
}];
}; };
}; };
}; };

View file

@ -41,6 +41,8 @@
}; };
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "paperless-ngx-data";
containers.paperless-ngx = { containers.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"; }];
@ -50,35 +52,22 @@
protocol = "TCP"; protocol = "TCP";
}]; }];
env = [ env = {
{ PAPERLESS_DBPASS.valueFrom.secretKeyRef = {
name = "PAPERLESS_DBPASS"; name = "paperless-ngx";
key = "databasePassword";
valueFrom.secretKeyRef = { };
name = "paperless-ngx"; PAPERLESS_SECRET_KEY.valueFrom.secretKeyRef = {
key = "databasePassword"; name = "paperless-ngx";
}; key = "secretKey";
} };
{ };
name = "PAPERLESS_SECRET_KEY";
valueFrom.secretKeyRef = {
name = "paperless-ngx";
key = "secretKey";
};
}
];
volumeMounts = [{ volumeMounts = [{
name = "data"; name = "data";
mountPath = "/data"; mountPath = "/data";
}]; }];
}; };
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "paperless-ngx-data";
}];
}; };
}; };
}; };
@ -103,6 +92,8 @@
}; };
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "paperless-ngx-redisdata";
containers.redis = { containers.redis = {
image = "docker.io/library/redis:7"; image = "docker.io/library/redis:7";
@ -116,11 +107,6 @@
mountPath = "/data"; mountPath = "/data";
}]; }];
}; };
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "paperless-ngx-redisdata";
}];
}; };
}; };
}; };

View file

@ -32,15 +32,10 @@
} }
]; ];
env = [{ env.WEBPASSWORD.valueFrom.secretKeyRef = {
# TODO: simplify this by using env.WEBPASSWORD? name = "pihole";
name = "WEBPASSWORD"; key = "webPassword";
};
valueFrom.secretKeyRef = {
name = "pihole";
key = "webPassword";
};
}];
volumeMounts = [ volumeMounts = [
{ {
@ -54,16 +49,10 @@
]; ];
}; };
volumes = [ volumes = {
{ data.persistentVolumeClaim.claimName = "pihole-data";
name = "data"; dnsmasq.persistentVolumeClaim.claimName = "pihole-dnsmasq";
persistentVolumeClaim.claimName = "pihole-data"; };
}
{
name = "dnsmasq";
persistentVolumeClaim.claimName = "pihole-dnsmasq";
}
];
}; };
}; };
}; };

View file

@ -68,16 +68,10 @@
]; ];
}; };
volumes = [ volumes = {
{ data.persistentVolumeClaim.claimName = "radicale";
name = "data"; config.configMap.name = "radicale";
persistentVolumeClaim.claimName = "radicale"; };
}
{
name = "config";
configMap.name = "radicale";
}
];
}; };
}; };
}; };

View file

@ -37,16 +37,10 @@
]; ];
}; };
volumes = [ volumes = {
{ config.persistentVolumeClaim.claimName = "syncthing";
name = "config"; nextcloud-data.persistentVolumeClaim.claimName = "nextcloud";
persistentVolumeClaim.claimName = "syncthing"; };
}
{
name = "nextcloud-data";
persistentVolumeClaim.claimName = "nextcloud";
}
];
}; };
}; };
}; };