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: 15, tcpSocket: { port: "http", }, }; local WebPort = 8080; local Params = kube.simpleFieldStruct([ "namespace", "name", "filePath", "configClaimName", "incompleteDownloadsClaimName", "downloadsClaimName", ]) { #local httpsWebPort = 9090, labels: {}, gatekeeperSidecar: null, lsParams: linuxserver.AppParams { name: $.name, namespace: $.namespace, filePath: $.filePath, templatePath: std.thisFile, baseAppName: "sabnzbd", imageName: "linuxserver/sabnzbd", labels+: $.labels, gatekeeperSidecar: $.gatekeeperSidecar, services: [ linuxserver.Service { suffix: "ui", spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort) }, ], ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ], pvcs: [ linuxserver.Pvc{ name: "config", mountPath: "/config", bindName: $.configClaimName, }, linuxserver.Pvc{ name: "incomplete-downloads", mountPath: "/incomplete-downloads", bindName: $.incompleteDownloadsClaimName, }, linuxserver.Pvc{ name: "downloads", mountPath: "/downloads", bindName: $.downloadsClaimName, }, ], resources: { requests: { cpu: "100m", memory: "1024Mi", }, limits: { cpu: "400m", memory: "2024Mi", }, }, livenessProbe: probe(/*delaySeconds=*/120), readinessProbe: probe(/*delaySeconds=*/120), }, }; local App(params) = linuxserver.App(params.lsParams); { WebPort: WebPort, Params: Params, App(params): App(params), }