yesod-mirror/k8s/configs/templates/personal/media/audiobookshelf.libsonnet
Copybara 8157b39ea4
Some checks failed
CI / build (push) Failing after 12s
Project import generated by Copybara.
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
2026-01-20 21:26:21 +00:00

90 lines
2.1 KiB
Jsonnet

local kube = import "k8s/configs/base.libsonnet";
local linuxserver = import "k8s/configs/templates/core/linuxserver.libsonnet";
local images = import "k8s/configs/images.libsonnet";
local probe(delaySeconds) = {
initialDelaySeconds: delaySeconds,
periodSeconds: 30,
tcpSocket: {
port: "http",
},
};
local WebPort = 80;
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"audiobookClaimName",
"podcastClaimName",
"configClaimName",
"metadataClaimName",
]) {
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "audiobookshelf",
imageName: "ghcr.io/advplyr/audiobookshelf",
labels+: $.labels,
gatekeeperSidecar: $.gatekeeperSidecar,
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
env: linuxserver.Env {
others: [
#kube.NameVal("AUDIOBOOKSHELF_UID", "99"),
#kube.NameVal("AUDIOBOOKSHELF_GID", "0"),
]
},
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
},
],
pvcs: [
linuxserver.Pvc{
name: "audiobooks",
mountPath: "/audiobooks",
bindName: $.audiobookClaimName,
},
linuxserver.Pvc{
name: "podcasts",
mountPath: "/podcasts",
bindName: $.podcastClaimName,
},
linuxserver.Pvc{
name: "config",
mountPath: "/config",
bindName: $.configClaimName,
},
linuxserver.Pvc{
name: "metadata",
mountPath: "/metadata",
bindName: $.metadataClaimName,
},
],
resources: {
requests: {
cpu: "400m",
memory: "256Mi",
},
limits: {
cpu: "1500m",
memory: "512Mi",
},
},
livenessProbe: probe(/*delaySeconds=*/60),
readinessProbe: probe(/*delaySeconds=*/60),
},
};
local App(params) = linuxserver.App(params.lsParams) {};
{
Params: Params,
WebPort: WebPort,
App(params): App(params),
}