yesod-mirror/k8s/configs/environments/game/main.jsonnet

228 lines
8.3 KiB
Jsonnet
Raw Permalink Normal View History

local base = import "k8s/configs/base.libsonnet";
local minecraftServer = import "k8s/configs/templates/game/minecraft-server.libsonnet";
local bluemap = import "k8s/configs/templates/game/bluemap.libsonnet";
local palworld = import "k8s/configs/templates/game/palworld.libsonnet";
local nginxIngress = import "k8s/configs/templates/nginx-ingress.libsonnet";
local namespace = "game";
{
namespace: {
apiVersion: "v1",
kind: "Namespace",
metadata: {
name: namespace,
},
},
/*
newMinecraftServer: {
bluemapConfig: base.RecoverableSimpleManyPvc(namespace, "bluemap-config", "nfs-client", "5Gi", {
volumeName: "pvc-3c0765a0-1f19-4491-ac68-73cbaea93226",
nfsPath: "/volume3/fs/game-bluemap-config-pvc-3c0765a0-1f19-4491-ac68-73cbaea93226",
nfsServer: "apollo1.dominion.lan",
}),
bluemapData: base.RecoverableSimpleManyPvc(namespace, "bluemap-data", "nfs-client", "5Gi", {
volumeName: "pvc-530578ec-1d16-43ae-abec-e46d6746cf04",
nfsPath: "/volume3/fs/game-bluemap-data-pvc-530578ec-1d16-43ae-abec-e46d6746cf04",
nfsServer: "apollo1.dominion.lan",
}),
bluemapWeb: base.RecoverableSimpleManyPvc(namespace, "bluemap-web", "nfs-client", "5Gi", {
volumeName: "pvc-c4556edc-0c44-492e-99e3-e7490cc216ee",
nfsPath: "/volume3/fs/game-bluemap-web-pvc-c4556edc-0c44-492e-99e3-e7490cc216ee",
nfsServer: "apollo1.dominion.lan",
}),
mc1Pvc: base.RecoverableSimpleManyPvc(namespace, "mc3-data", "nfs-client", "20Gi", {
volumeName: "pvc-5b790223-82e3-4836-a886-4b77b012d005",
nfsPath: "/volume3/fs/game-mc3-data-pvc-5b790223-82e3-4836-a886-4b77b012d005",
nfsServer: "apollo1.dominion.lan",
}),
bluemap: bluemap.App(bluemap.Params {
namespace: namespace,
name: "bluemap",
filePath: std.thisFile,
configClaimName: "bluemap-config",
dataClaimName: "bluemap-data",
worldClaimName: "mc3-data",
webClaimName: "bluemap-web",
}),
bluemapIngress: nginxIngress.Ingress(nginxIngress.IngressParams {
namespace: namespace,
name: "mc3-map",
hosts: [
"mc3-map.csbx.dev",
],
serviceName: "bluemap-ui",
}),
app: minecraftServer.App(minecraftServer.Params {
namespace: namespace,
name: "mc3",
filePath: std.thisFile,
// Defined in "game"
dataClaimName: "mc3-data",
}),
nodeport: base.Service(namespace, "mc3-nodeports") {
spec+: {
type: "NodePort",
selector: {
name: "mc3",
phase: "prod",
},
ports: [
{
name: "minecraft-udp",
port: 25565,
protocol: "UDP",
targetPort: 25565,
nodePort: 32565,
},
{
name: "minecraft-tcp",
port: 25565,
protocol: "TCP",
targetPort: 25565,
nodePort: 32565,
},
],
}
},
ingress: nginxIngress.Ingress(nginxIngress.IngressParams {
namespace: namespace,
name: "mc3",
hosts: [
"mc3.csbx.dev",
"mc3.cheapassbox.com",
],
serviceName: "mc3-ui",
}),
},
*/
/*
minecraftServer: {
mc1Pvc: kube.RecoverableSimpleManyPvc(namespace, "mc1-data", "nfs-client", "20Gi", {
volumeName: "pvc-b0e1c6d2-d796-4c0a-bef3-8239301e2b8a",
nfsPath: "/volume3/fs/game-mc1-data-pvc-b0e1c6d2-d796-4c0a-bef3-8239301e2b8a",
nfsServer: "apollo1.dominion.lan",
}),
app: minecraftServer.App(minecraftServer.Params {
namespace: namespace,
name: "mc1",
filePath: std.thisFile,
// Defined in "game"
dataClaimName: "mc1-data",
}),
nodeport: kube.Service(namespace, "mc1-nodeports") {
spec+: {
type: "NodePort",
selector: {
name: "mc1",
phase: "prod",
},
ports: [
{
name: "minecraft-udp",
port: 25565,
protocol: "UDP",
targetPort: 25565,
nodePort: 32565,
},
{
name: "minecraft-tcp",
port: 25565,
protocol: "TCP",
targetPort: 25565,
nodePort: 32565,
},
],
}
},
ingress: nginxIngress.Ingress(nginxIngress.IngressParams {
namespace: namespace,
name: "mc1",
hosts: [
"mc1.csbx.dev",
"mc1.cheapassbox.com",
],
serviceName: "mc1-ui",
}),
}
},
*/
/*
palworld: {
pvcs: {
palworldPvc: kube.RecoverableSimpleManyPvc(namespace, "palworld-data", "nfs-client", "20Gi", {
volumeName: "pvc-66037b7e-7edd-46b0-b26e-821df8188dd2",
nfsPath: "/volume3/fs/game-palworld-data-pvc-66037b7e-7edd-46b0-b26e-821df8188dd2",
nfsServer: "apollo1.dominion.lan",
}),
palworld2Pvc: kube.RecoverableSimpleManyPvc(namespace, "palworld-second-data", "nfs-client", "20Gi", {
volumeName: "pvc-a4932e90-d0fa-4628-946c-7676aa6408dc",
nfsPath: "/volume3/fs/game-palworld-second-data-pvc-a4932e90-d0fa-4628-946c-7676aa6408dc",
nfsServer: "apollo1.dominion.lan",
}),
palworld3Pvc: kube.RecoverableSimpleManyPvc(namespace, "palworld-third-data", "nfs-client", "20Gi", {
volumeName: "pvc-15bc4437-be4b-4451-a778-e0fdb9ad9bc6",
nfsPath: "/volume3/fs/game-palworld-third-data-pvc-15bc4437-be4b-4451-a778-e0fdb9ad9bc6",
nfsServer: "apollo1.dominion.lan",
}),
},
world1: {
app: palworld.App(palworld.Params {
namespace: namespace,
name: "palworld",
configMapName: "palworld-config",
filePath: std.thisFile,
// Defined in "game"
//dataClaimName: "palworld-data",
dataClaimName: "palworld-third-data",
gameNodePort: 32520,
queryNodePort: 32521,
}),
ingress: nginxIngress.Ingress(nginxIngress.IngressParams {
namespace: namespace,
name: "palworld",
hosts: [
"palworld.csbx.dev",
"pal.csbx.dev",
],
serviceName: "palworld-game",
}),
},
world2: {
local _params = palworld.Params {
namespace: namespace,
name: "palworld2",
configMapName: "palworld2-config",
filePath: std.thisFile,
// Defined in "game"
dataClaimName: "palworld-data",
gameNodePort: 32522,
queryNodePort: 32523,
lsParams +: {
resources: {
requests: {
cpu: "1000m",
memory: "6Gi",
},
limits: {
cpu: "2000m",
memory: "11Gi",
},
},
},
},
configmap: palworld.ConfigMap($._params),
app: palworld.App($._params),
ingress: nginxIngress.Ingress(nginxIngress.IngressParams {
namespace: namespace,
name: "palworld2",
hosts: [
"pal2.csbx.dev",
],
serviceName: "palworld2-game",
}),
},
},
*/
}