yesod-mirror/k8s/configs/templates/dev/ai/open-webui-pipelines.libsonnet

76 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 = 9099;
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"storageClaimName",
]) {
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "open-webui-pipelines",
imageName: "ghcr.io/open-webui/pipelines",
labels+: $.labels,
gatekeeperSidecar: $.gatekeeperSidecar,
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
},
],
env: linuxserver.Env {
others: [
/*
kube.NameVal("NVIDIA_VISIBLE_DEVICES", "all"),
kube.NameVal("NVIDIA_DRIVER_CAPABILITIES", "all"),
*/
],
},
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
pvcs: [
linuxserver.Pvc{
name: "storage",
mountPath: "/app/pipelines",
bindName: $.storageClaimName,
},
],
resources: {
requests: {
cpu: "500m",
memory: "1Gi",
},
limits: {
cpu: "1000m",
memory: "2Gi",
},
},
livenessProbe: probe(/*delaySeconds=*/30),
readinessProbe: probe(/*delaySeconds=*/20),
},
};
local App(params) = linuxserver.App(params.lsParams);
{
Params: Params,
WebPort: WebPort,
App(params): App(params),
}