| local kube = import "../../../kube/kube.libsonnet"; |
| |
| { |
| local top = self, |
| local cfg = top.cfg, |
| local ns = kube.Namespace(cfg.namespace), |
| |
| cfg:: { |
| image:: "registry.k0.hswaw.net/games/factorio/modproxy:1589157915-eafe7be328477e8a6590c4210466ef12901f1b9a", |
| namespace: error "namespace must be set", |
| }, |
| |
| pvc: ns.Contain(kube.PersistentVolumeClaim("proxy-cas")) { |
| storage:: "32Gi", |
| storageClass:: "waw-hdd-redundant-3", |
| }, |
| |
| deploy: ns.Contain(kube.Deployment("proxy")) { |
| spec+: { |
| template+: { |
| spec+: { |
| volumes_: { |
| cas: top.pvc.volume, |
| }, |
| 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: ns.Contain(kube.Service("proxy")) { |
| target:: top.deploy, |
| }, |
| } |