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 = 8443; local Params = kube.simpleFieldStruct([ "namespace", "name", "filePath", "configClaimName", ]) { labels: {}, gatekeeperSidecar: null, lsParams: linuxserver.AppParams { name: $.name, namespace: $.namespace, filePath: $.filePath, templatePath: std.thisFile, baseAppName: "code-server", imageName: "linuxserver/code-server", labels+: $.labels, gatekeeperSidecar: $.gatekeeperSidecar, env: linuxserver.Env { others+: [ kube.NameVal("SERVICE_URL", "https://marketplace.visualstudio.com/_apis/public/gallery"), kube.NameVal("ITEM_URL", "https://marketplace.visualstudio.com/items"), ], }, services: [ linuxserver.Service { suffix: "ui", spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort) }, ], ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ], pvcs: [ linuxserver.Pvc{ name: "config", mountPath: "/config", bindName: $.configClaimName, }, ], resources: { requests: { cpu: "1500m", memory: "1Gi", }, limits: { cpu: "2500m", memory: "2Gi", }, }, livenessProbe: probe(/*delaySeconds=*/120), readinessProbe: probe(/*delaySeconds=*/120), }, }; local App(params) = linuxserver.App(params.lsParams); { Params: Params, WebPort: WebPort, App(params): App(params), }