yesod-mirror/k8s/configs/templates/personal/media/transmission.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

95 lines
2.3 KiB
Jsonnet

local kube = import "k8s/configs/base.libsonnet";
local linuxserver = import "k8s/configs/templates/core/linuxserver.libsonnet";
local WebPort = 9091;
local transmissionProbe(delaySeconds) = {
httpGet: {
path: "/",
port: WebPort,
},
initialDelaySeconds: delaySeconds,
};
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"configClaimName",
"torrentFilesClaimName",
"incompleteDownloadsClaimName",
"downloadsClaimName",
"dataNodePort",
]) {
local dataInternalPort = 51413,
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "transmission",
imageName: "linuxserver/transmission",
gatekeeperSidecar: $.gatekeeperSidecar,
labels+: $.labels,
env: linuxserver.Env {
others: [
kube.NameVal("S6_KILL_FINISH_MAXTIME", "100000"),
]
},
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
},
linuxserver.Service {
suffix: "data",
spec: kube.SvcUtil.BasicNodePortSpec(dataInternalPort, $.dataNodePort),
},
],
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
pvcs: [
linuxserver.Pvc{
name: "config",
mountPath: "/config",
bindName: $.configClaimName
},
linuxserver.Pvc{
name: "incomplete",
mountPath: "/downloads/incomplete",
bindName: $.incompleteDownloadsClaimName,
},
linuxserver.Pvc{
name: "downloads",
mountPath: "/downloads/complete",
bindName: $.downloadsClaimName,
},
linuxserver.Pvc{
name: "torrent-files",
mountPath: "/watch",
bindName: $.torrentFilesClaimName
},
],
resources: {
requests: {
cpu: "250m",
memory: "1000Mi",
},
limits: {
cpu: "500m",
memory: "2000Mi",
},
},
livenessProbe: transmissionProbe(/*delaySeconds=*/360),
readinessProbe: transmissionProbe(/*delaySeconds=*/120),
},
};
local App(params) = linuxserver.App(params.lsParams);
{
WebPort: WebPort,
Params: Params,
App(params): App(params),
}