yesod-mirror/k8s/configs/templates/dev/tools/changedetection.libsonnet

73 lines
1.7 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 = 5000;
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"playwrightDriverUrl",
"datastoreClaimName",
]) {
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "changedetection",
imageName: "dgtlmoon/changedetection.io",
labels+: $.labels,
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
env: linuxserver.Env {
others: [
kube.NameVal("PLAYWRIGHT_DRIVER_URL", $.playwrightDriverUrl),
#https://www.browserless.io/docs/docker#securing-your-instance
]
},
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
},
],
pvcs: [
linuxserver.Pvc{
name: "datastore",
mountPath: "/datastore",
bindName: $.datastoreClaimName,
},
],
resources: {
requests: {
cpu: "250m",
memory: "512Mi",
},
limits: {
cpu: "500m",
memory: "1Gi",
},
},
livenessProbe: probe(/*delaySeconds=*/20),
readinessProbe: probe(/*delaySeconds=*/20),
},
};
local App(params) = linuxserver.App(params.lsParams) {};
{
Params: Params,
WebPort: WebPort,
App(params): App(params),
}