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), }