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

108 lines
3 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,
udpSocket: {
port: "query",
},
};
local GamePort = 8211;
local QueryPort = 27015;
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"dataClaimName",
"gameNodePort",
"queryNodePort",
]) {
labels: {},
gatekeeperSidecar: null,
configMapName: $.name + "-config",
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "palworld",
imageName: "thijsvanloef/palworld-server-docker",
labels+: $.labels,
gatekeeperSidecar: $.gatekeeperSidecar,
ports: [
kube.DeployUtil.ContainerPort("game", GamePort) {
protocol: "UDP",
},
kube.DeployUtil.ContainerPort("query", QueryPort) {
protocol: "UDP",
},
],
env: linuxserver.Env {
others: [
//kube.NameVal("PUID","1000"),
//kube.NameVal("PGID","1000"),
kube.NameVal("PORT", std.toString(GamePort)),
kube.NameVal("PLAYERS", "6"),
kube.NameVal("MULTITHREADING", "TRUE"),
kube.NameVal("COMMUNITY", "FALSE"),
//kube.NameVal("PUBLIC_IP", "23.139.112.166"),
kube.NameVal("SERVER_NAME", "Sanders Pal Server"),
//kube.NameVal("SERVER_PASSWORD", "example-password"),
#kube.NameVal("PUBLIC_IP", "FALSE"),
#kube.NameVal("PUBLIC_PORT", std.toString($.gameNodePort)),
kube.NameVal("ADMIN_PASSWORD", "example-password"),
kube.NameVal("EXP_RATE", "2.0"),
kube.NameVal("PAL_CAPTURE_RATE", "2.0"),
kube.NameVal("BUILD_OBJECT_DETERIORATION_DAMAGE_RATE", "0.0"),
kube.NameVal("AUTO_RESET_GUILD_TIME_NO_ONLINE_PLAYERS", "7000.0"),
kube.NameVal("DEATH_PENALTY", "ITEM"),
kube.NameVal("PAL_EGG_DEFAULT_HATCHING_TIME", "1.0"),
kube.NameVal("WORK_SPEED_RATE", "2.0"),
kube.NameVal("ENABLE_NON_LOGIN_PENALTY", "FALSE"),
]
},
services: [
linuxserver.Service {
suffix: "game",
spec: kube.SvcUtil.BasicNodePortSpec(GamePort, $.gameNodePort),
},
linuxserver.Service {
suffix: "query",
spec: kube.SvcUtil.BasicNodePortSpec(QueryPort, $.queryNodePort),
},
],
pvcs: [
linuxserver.Pvc{
name: "data",
mountPath: "/palworld",
bindName: $.dataClaimName,
},
],
resources: {
requests: {
cpu: "2000m",
memory: "16Gi",
},
limits: {
cpu: "4000m",
memory: "24Gi",
},
},
//livenessProbe: probe(/*delaySeconds=*/60),
//readinessProbe: probe(/*delaySeconds=*/60),
},
};
local App(params) = linuxserver.App(params.lsParams) {
};
{
Params: Params,
GamePort: GamePort,
QueryPort: QueryPort,
//ConfigMap(params): ConfigMap(params),
App(params): App(params),
}