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 = 5572; local Params = kube.simpleFieldStruct([ "namespace", "name", "filePath", "configClaimName", "dataClaimName", "redisHost", "schedule", ]) { labels: {}, gatekeeperSidecar: null, lsParams: linuxserver.AppParams { name: $.name, namespace: $.namespace, filePath: $.filePath, templatePath: std.thisFile, baseAppName: "rclone", imageName: "rclone/rclone", labels+: $.labels, gatekeeperSidecar: $.gatekeeperSidecar, isPrivileged: true, schedule: $.schedule, services: [ linuxserver.Service { suffix: "ui", spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort) }, ], command: [ "rclone" ], args: [ "move", "box-paperless:paperless-ng/", "/data/consume", //"--rc-web-gui", //"--rc-baseurl http://rclone-paperless.csbx.dev" //"--rc-addr=:5572", //"--rc-no-auth", //"--rc-web-gui-no-open-browser", ], ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ], env: linuxserver.Env { others: [ //kube.NameVal("REDIS_URL", $.redisHost), ] }, pvcs: [ linuxserver.Pvc{ name: "config", mountPath: "/config", bindName: $.configClaimName, }, linuxserver.Pvc{ name: "data", mountPath: "/data", bindName: $.dataClaimName, }, ], hostPaths: [ linuxserver.HostPath{ name: "fuse", hostPath: "/dev/fuse", mountPath: "/dev/fuse", }, ], resources: { requests: { cpu: "500m", memory: "500Mi", }, limits: { cpu: "600m", memory: "600Mi", }, }, livenessProbe: probe(/*delaySeconds=*/20), readinessProbe: probe(/*delaySeconds=*/20), }, }; local Cron(params) = linuxserver.Cron(params.lsParams); { WebPort: WebPort, Params: Params, Cron(params): Cron(params), }