blob: eb200c93ba9dc5057e17b130beaa993b048e7bef [file] [log] [blame]
local factorio = import "factorio.libsonnet";
local kube = import "../../../kube/kube.libsonnet";
// This deploys factorio instances and the modproxy in the `factorio`
// Kubernetes namespace.
//
// Available factorio versions:
// - 1.0.0-1
// - 1.1.34-1
// See: //third_party/factorio.
{
local prod = self,
proxyImage:: "registry.k0.hswaw.net/games/factorio/modproxy:1589157915-eafe7be328477e8a6590c4210466ef12901f1b9a",
namespace: kube.Namespace("factorio"),
instance(name, tag):: factorio {
cfg+: {
namespace: "factorio",
prefix: name + "-",
tag: tag,
proxyImage: prod.proxyImage,
}
},
proxy: {
pvc: kube.PersistentVolumeClaim("proxy-cas") {
metadata+: {
namespace: "factorio",
},
spec+: {
storageClassName: "waw-hdd-redundant-3",
accessModes: [ "ReadWriteOnce" ],
resources: {
requests: {
storage: "32Gi",
},
},
},
},
deploy: kube.Deployment("proxy") {
metadata+: {
namespace: "factorio",
},
spec+: {
template+: {
spec+: {
volumes_: {
cas: kube.PersistentVolumeClaimVolume(prod.proxy.pvc),
},
containers_: {
proxy: kube.Container("proxy") {
image:prod.proxyImage,
command: [
"/games/factorio/modproxy/modproxy",
"-hspki_disable",
"-cas_directory", "/mnt/cas",
"-listen_address", "0.0.0.0:4200",
],
volumeMounts_: {
cas: { mountPath: "/mnt/cas" },
},
ports_: {
client: { containerPort: 4200 },
},
},
},
},
},
},
},
svc: kube.Service("proxy") {
metadata+: {
namespace: "factorio",
},
target_pod:: prod.proxy.deploy.spec.template,
spec+: {
ports: [
{ name: "client", port: 4200, targetPort: 4200, protocol: "TCP" },
],
},
},
},
local mod = function(name, version) { name: name, version: version },
pymods: prod.instance("pymods", "1.1.34-1") {
cfg+: {
mods: [
// Stdlib for mods
mod("stdlib", "1.4.6"),
// General QOL
// Better loaders
mod("LoaderRedux", "1.7.1"),
mod("LoaderReduxForFactorioExtendedPlus", "1.1.0"),
// Trains
mod("traintunnels", "0.0.11"),
mod("FARL", "4.1.2"),
// Move between buildings
mod("Squeak Through", "1.8.2"),
// Requirements calculator
mod("helmod", "0.12.5"),
// Compact loaders for easier and faster transportation
mod("deadlock-beltboxes-loaders", "2.4.2"),
// Better inserters
mod("bobinserters", "1.1.0"),
// Teleport to tags for easier movement with huge server
mod("TagToTeleport", "1.1.1"),
// Necessary for PYmods to get proper list of ingredients for the next step
mod("what-is-it-really-used-for", "1.6.0"),
// Resource monitor
mod("YARM", "0.8.203"),
// YEET
mod("RenaiTransportation", "0.8.6"),
// PYmods
mod("pypetroleumhandling", "2.0.6"),
mod("pyrawores", "2.2.7"),
mod("pyraworesgraphics", "1.0.9"),
mod("pycoalprocessing", "1.9.3"),
mod("pycoalprocessinggraphics", "1.0.9"),
// Resource overhaul
mod("rso-mod", "6.2.6")
],
},
},
}