yesod-mirror/k8s/configs/templates/dev/ide/jupyter.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

65 lines
1.5 KiB
Jsonnet

local kube = import "k8s/configs/base.libsonnet";
local linuxserver = import "k8s/configs/templates/core/linuxserver.libsonnet";
local images = import "k8s/configs/images.libsonnet";
local jupyterProbe(delaySeconds) = {
initialDelaySeconds: delaySeconds,
periodSeconds: 15,
tcpSocket: {
port: "http",
},
};
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"filesClaimName",
]) {
local webPort = 8888,
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "jupyter",
imageName: "jupyter/datascience-notebook",
labels+: $.labels,
gatekeeperSidecar: $.gatekeeperSidecar,
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(webPort)
},
],
ports: [ kube.DeployUtil.ContainerPort("http", webPort), ],
pvcs: [
linuxserver.Pvc{
name: "files",
mountPath: "/home/joyvan/work",
bindName: $.filesClaimName,
},
],
resources: {
requests: {
cpu: "500m",
memory: "1000Mi",
},
limits: {
cpu: "2000m",
memory: "4000Mi",
},
},
//livenessProbe: jupyterProbe(/*delaySeconds=*/120),
//readinessProbe: jupyterProbe(/*delaySeconds=*/120),
},
};
local App(params) = linuxserver.App(params.lsParams);
{
Params: Params,
App(params): App(params),
}