blob: a25ba7c0329eb49aebe172edd5f1624d23ef61fd [file] [log] [blame]
local kube = import "../../../kube/kube.libsonnet";
{
local proxy = self,
local cfg = proxy.cfg,
cfg:: {
image:: "registry.k0.hswaw.net/games/factorio/modproxy:1589157915-eafe7be328477e8a6590c4210466ef12901f1b9a",
namespace: error "namespace must be set",
},
pvc: kube.PersistentVolumeClaim("proxy-cas") {
metadata+: {
namespace: cfg.namespace,
},
storage: "32Gi",
storageClass: "waw-hdd-redundant-3",
},
deploy: kube.Deployment("proxy") {
metadata+: {
namespace: "factorio",
},
spec+: {
template+: {
spec+: {
volumes_: {
cas: kube.PersistentVolumeClaimVolume(proxy.pvc),
},
containers_: {
proxy: kube.Container("proxy") {
image: cfg.image,
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:: proxy.deploy,
spec+: {
ports: [
{ name: "client", port: 4200, targetPort: 4200, protocol: "TCP" },
],
},
},
}