Some checks failed
CI / build (push) Failing after 12s
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
76 lines
1.6 KiB
Jsonnet
76 lines
1.6 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 probe(delaySeconds) = {
|
|
initialDelaySeconds: delaySeconds,
|
|
periodSeconds: 30,
|
|
tcpSocket: {
|
|
port: "http",
|
|
},
|
|
};
|
|
|
|
local WebPort = 8080;
|
|
|
|
local Params = kube.simpleFieldStruct([
|
|
"namespace",
|
|
"name",
|
|
"filePath",
|
|
"dataClaimName",
|
|
]) {
|
|
labels: {},
|
|
mountSubPath: null,
|
|
gatekeeperSidecar: null,
|
|
lsParams: linuxserver.AppParams {
|
|
name: $.name,
|
|
namespace: $.namespace,
|
|
filePath: $.filePath,
|
|
templatePath: std.thisFile,
|
|
baseAppName: "kiwix",
|
|
imageName: "kiwix/kiwix-serve",
|
|
labels+: $.labels,
|
|
gatekeeperSidecar: $.gatekeeperSidecar,
|
|
env: linuxserver.Env {
|
|
others+: [
|
|
],
|
|
},
|
|
args: [
|
|
"*.zim",
|
|
],
|
|
services: [
|
|
linuxserver.Service {
|
|
suffix: "ui",
|
|
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
|
|
},
|
|
],
|
|
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
|
|
pvcs: [
|
|
linuxserver.Pvc{
|
|
name: "data",
|
|
mountPath: "/data",
|
|
bindName: $.dataClaimName,
|
|
mountSubPath: $.mountSubPath,
|
|
},
|
|
],
|
|
resources: {
|
|
requests: {
|
|
cpu: "150m",
|
|
memory: "512Mi",
|
|
},
|
|
limits: {
|
|
cpu: "250m",
|
|
memory: "1Gi",
|
|
},
|
|
},
|
|
livenessProbe: probe(/*delaySeconds=*/20),
|
|
readinessProbe: probe(/*delaySeconds=*/20),
|
|
},
|
|
};
|
|
|
|
local App(params) = linuxserver.App(params.lsParams);
|
|
|
|
{
|
|
Params: Params,
|
|
WebPort: WebPort,
|
|
App(params): App(params),
|
|
}
|