Serge Bazanski | c684ca9 | 2021-06-12 22:02:25 +0000 | [diff] [blame] | 1 | local kube = import "../../../kube/kube.libsonnet"; |
| 2 | |
| 3 | { |
| 4 | local proxy = self, |
| 5 | local cfg = proxy.cfg, |
| 6 | |
| 7 | cfg:: { |
| 8 | image:: "registry.k0.hswaw.net/games/factorio/modproxy:1589157915-eafe7be328477e8a6590c4210466ef12901f1b9a", |
| 9 | namespace: error "namespace must be set", |
| 10 | }, |
| 11 | |
| 12 | pvc: kube.PersistentVolumeClaim("proxy-cas") { |
| 13 | metadata+: { |
| 14 | namespace: cfg.namespace, |
| 15 | }, |
radex | 36964dc | 2023-11-24 11:19:46 +0100 | [diff] [blame^] | 16 | storage:: "32Gi", |
| 17 | storageClass:: "waw-hdd-redundant-3", |
Serge Bazanski | c684ca9 | 2021-06-12 22:02:25 +0000 | [diff] [blame] | 18 | }, |
| 19 | deploy: kube.Deployment("proxy") { |
| 20 | metadata+: { |
| 21 | namespace: "factorio", |
| 22 | }, |
| 23 | spec+: { |
| 24 | template+: { |
| 25 | spec+: { |
| 26 | volumes_: { |
| 27 | cas: kube.PersistentVolumeClaimVolume(proxy.pvc), |
| 28 | }, |
| 29 | containers_: { |
| 30 | proxy: kube.Container("proxy") { |
| 31 | image: cfg.image, |
| 32 | command: [ |
| 33 | "/games/factorio/modproxy/modproxy", |
| 34 | "-hspki_disable", |
| 35 | "-cas_directory", "/mnt/cas", |
| 36 | "-listen_address", "0.0.0.0:4200", |
| 37 | ], |
| 38 | volumeMounts_: { |
| 39 | cas: { mountPath: "/mnt/cas" }, |
| 40 | }, |
| 41 | ports_: { |
| 42 | client: { containerPort: 4200 }, |
| 43 | }, |
| 44 | }, |
| 45 | }, |
| 46 | }, |
| 47 | }, |
| 48 | }, |
| 49 | }, |
| 50 | svc: kube.Service("proxy") { |
| 51 | metadata+: { |
| 52 | namespace: "factorio", |
| 53 | }, |
radex | 8b8f387 | 2023-11-24 11:09:46 +0100 | [diff] [blame] | 54 | target:: proxy.deploy, |
Serge Bazanski | c684ca9 | 2021-06-12 22:02:25 +0000 | [diff] [blame] | 55 | spec+: { |
| 56 | ports: [ |
| 57 | { name: "client", port: 4200, targetPort: 4200, protocol: "TCP" }, |
| 58 | ], |
| 59 | }, |
| 60 | }, |
| 61 | } |