local kube = import "k8s/configs/base.libsonnet"; local linuxserver = import "k8s/configs/templates/core/linuxserver.libsonnet"; local images = import "k8s/configs/images.libsonnet"; local hastebinProbe(delaySeconds) = { initialDelaySeconds: delaySeconds, periodSeconds: 30, tcpSocket: { port: "http", }, }; local WebPort = 8080; local Params = kube.simpleFieldStruct([ "namespace", "name", "filePath", "dataClaimName", ]) { labels: {}, gatekeeperSidecar: null, lsParams: linuxserver.AppParams { name: $.name, namespace: $.namespace, filePath: $.filePath, templatePath: std.thisFile, baseAppName: "hastebin", imageName: "privatebin/nginx-fpm-alpine", labels+: $.labels, gatekeeperSidecar: $.gatekeeperSidecar, env: linuxserver.Env { others: [ kube.NameVal("NODE_RED_ENABLE_PROJECTS", "true"), ] }, services: [ linuxserver.Service { suffix: "ui", spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort) }, ], ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ], pvcs: [ linuxserver.Pvc{ name: "data", mountPath: "/srv/data", bindName: $.dataClaimName, }, ], resources: { requests: { cpu: "20m", memory: "128Mi", }, limits: { cpu: "50m", memory: "256Mi", }, }, livenessProbe: hastebinProbe(/*delaySeconds=*/60), readinessProbe: hastebinProbe(/*delaySeconds=*/60), }, }; local App(params) = linuxserver.App(params.lsParams); { Params: Params, WebPort: WebPort, App(params): App(params), }