yesod-mirror/k8s/configs/templates/personal/media/audiobookshelf.libsonnet

91 lines
2.1 KiB
Jsonnet
Raw Normal View History

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),
}