| 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, |
| }, |
| 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(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_pod:: proxy.deploy.spec.template, |
| spec+: { |
| ports: [ |
| { name: "client", port: 4200, targetPort: 4200, protocol: "TCP" }, |
| ], |
| }, |
| }, |
| } |