blob: 27dd38d440a9e6ed87f9d5d9a4fee320e48b3aff [file] [log] [blame]
local factorio = import "factorio.libsonnet";
local kube = import "../../../../kube/kube.libsonnet";
// Available versions:
// - 0.18.40-1
// - 1.0.0-1
{
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 },
q3k: prod.instance("q3k", "1.0.0-1") {
cfg+: {
mods: [
mod("Squeak Through", "1.8.0"),
mod("Bottleneck", "0.11.4"),
],
},
},
pymods: prod.instance("pymods", "1.0.0-1") {
cfg+: {
mods: [
mod("Bottleneck", "0.11.4"),
mod("FARL", "4.0.2"),
mod("Squeak Through", "1.8.0"),
mod("pycoalprocessing", "1.8.3"),
mod("pycoalprocessinggraphics", "1.0.7"),
mod("pyfusionenergy", "1.6.3"),
mod("pyfusionenergygraphics", "1.0.5"),
mod("pyhightech", "1.6.2"),
mod("pyhightechgraphics", "1.0.8"),
mod("pyindustry", "1.4.7"),
mod("pyrawores", "2.1.5"),
mod("pyraworesgraphics", "1.0.4"),
mod("rso-mod", "6.0.11"),
mod("stdlib", "1.4.3"),
mod("what-is-it-really-used-for", "1.5.13"),
],
},
},
}