yesod-mirror/k8s/configs/templates/personal/media/bookstack.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

103 lines
2.4 KiB
Jsonnet

local kube = import "k8s/configs/base.libsonnet";
local images = import "k8s/configs/images.libsonnet";
local linuxserver = import "k8s/configs/templates/core/linuxserver.libsonnet";
local WebPort = 80;
local bookstackProbe(delaySeconds) = {
initialDelaySeconds: delaySeconds,
periodSeconds: 20,
httpGet: {
path: "/",
port: WebPort,
},
};
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"mariaDbUser",
"mariaDbDatabase",
"mariaDbService",
"mariaDbNamespace",
"secretName",
"secretDbPwdKey",
"ingressHost",
"configClaimName",
]) {
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "bookstack",
imageName: "linuxserver/bookstack",
labels+: $.labels,
gatekeeperSidecar: $.gatekeeperSidecar,
env: linuxserver.Env {
others: [
kube.NameVal("DB_HOST",
$.mariaDbService + "." + $.mariaDbNamespace + ".svc.cluster.local"),
kube.NameVal("DB_USERNAME", $.mariaDbUser),
kube.NameVal("DB_DATABASE", $.mariaDbDatabase),
kube.NameVal("APP_URL", "https://" + $.ingressHost),
{
name: "DB_PASSWORD",
valueFrom: {
secretKeyRef: {
name: $.secretName,
key: $.secretDbPwdKey,
}
}
},
{
name: "APP_KEY",
valueFrom: {
secretKeyRef: {
name: $.secretName,
key: "bookstack-app-key",
}
}
}
]
},
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
},
],
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
pvcs: [
linuxserver.Pvc{
name: "bookstack-config",
mountPath: "/config",
bindName: $.configClaimName,
},
],
resources: {
requests: {
cpu: "100m",
memory: "200Mi",
},
limits: {
cpu: "200m",
memory: "400Mi",
},
},
livenessProbe: bookstackProbe(/*delaySeconds=*/120),
readinessProbe: bookstackProbe(/*delaySeconds=*/120),
},
};
local App(params) = linuxserver.App(params.lsParams);
{
WebPort: WebPort,
Params: Params,
App(params): App(params),
}