yesod-mirror/k8s/configs/templates/personal/game/bluemap.libsonnet

100 lines
2.1 KiB
Jsonnet
Raw Permalink Normal View History

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 = 8100;
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"configClaimName",
"dataClaimName",
"webClaimName",
"worldClaimName",
]) {
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "bluemap",
imageName: "bluemap-minecraft/bluemap",
labels+: $.labels,
args: [
"-r",
"-u",
"-w",
],
services: [
linuxserver.Service {
suffix: "ui",
spec: {
type: "ClusterIP",
ports: [
kube.SvcUtil.TCPServicePort("http", 80) {
targetPort: WebPort
},
],
},
},
],
ports: [
kube.DeployUtil.ContainerPort("http", WebPort),
],
pvcs: [
linuxserver.Pvc{
name: "config",
mountPath: "/app/config",
bindName: $.configClaimName,
},
linuxserver.Pvc{
name: "data",
mountPath: "/app/data",
bindName: $.dataClaimName,
},
linuxserver.Pvc{
name: "world",
mountPath: "/app/world",
bindName: $.worldClaimName,
mountSubPath: "world"
},
linuxserver.Pvc{
name: "web",
mountPath: "/app/web",
bindName: $.webClaimName,
},
],
resources: {
requests: {
cpu: "500m",
memory: "2000Mi",
},
limits: {
cpu: "1000m",
memory: "4000Mi",
},
},
livenessProbe: probe(/*delaySeconds=*/30),
readinessProbe: probe(/*delaySeconds=*/90),
},
};
local App(params) = linuxserver.App(params.lsParams);
{
Params: Params,
WebPort: WebPort,
App(params): App(params),
}