Sergiusz Bazanski | cb5c321 | 2019-05-19 03:10:17 +0200 | [diff] [blame] | 1 | local factorio = import "factorio.libsonnet"; |
Sergiusz Bazanski | 7fb4acb | 2019-07-21 17:02:12 +0200 | [diff] [blame] | 2 | local kube = import "../../../../kube/kube.libsonnet"; |
Sergiusz Bazanski | cb5c321 | 2019-05-19 03:10:17 +0200 | [diff] [blame] | 3 | |
| 4 | |
| 5 | // Available versions: |
Serge Bazanski | 970b768 | 2020-08-04 20:33:17 +0200 | [diff] [blame] | 6 | // - 0.18.40-1 |
Serge Bazanski | 791ab6d | 2020-08-14 10:34:29 +0000 | [diff] [blame] | 7 | // - 1.0.0-1 |
Sergiusz Bazanski | cb5c321 | 2019-05-19 03:10:17 +0200 | [diff] [blame] | 8 | |
| 9 | { |
| 10 | local prod = self, |
| 11 | |
Sergiusz Bazanski | 0581bbf | 2020-05-11 03:21:32 +0200 | [diff] [blame] | 12 | proxyImage:: "registry.k0.hswaw.net/games/factorio/modproxy:1589157915-eafe7be328477e8a6590c4210466ef12901f1b9a", |
| 13 | |
Sergiusz Bazanski | cb5c321 | 2019-05-19 03:10:17 +0200 | [diff] [blame] | 14 | namespace: kube.Namespace("factorio"), |
| 15 | instance(name, tag):: factorio { |
| 16 | cfg+: { |
| 17 | namespace: "factorio", |
| 18 | prefix: name + "-", |
| 19 | tag: tag, |
Sergiusz Bazanski | 0581bbf | 2020-05-11 03:21:32 +0200 | [diff] [blame] | 20 | proxyImage: prod.proxyImage, |
Sergiusz Bazanski | cb5c321 | 2019-05-19 03:10:17 +0200 | [diff] [blame] | 21 | } |
| 22 | }, |
| 23 | |
Sergiusz Bazanski | 0581bbf | 2020-05-11 03:21:32 +0200 | [diff] [blame] | 24 | proxy: { |
| 25 | pvc: kube.PersistentVolumeClaim("proxy-cas") { |
| 26 | metadata+: { |
| 27 | namespace: "factorio", |
| 28 | }, |
| 29 | spec+: { |
| 30 | storageClassName: "waw-hdd-redundant-3", |
| 31 | accessModes: [ "ReadWriteOnce" ], |
| 32 | resources: { |
| 33 | requests: { |
| 34 | storage: "32Gi", |
| 35 | }, |
| 36 | }, |
| 37 | }, |
| 38 | }, |
| 39 | deploy: kube.Deployment("proxy") { |
| 40 | metadata+: { |
| 41 | namespace: "factorio", |
| 42 | }, |
| 43 | spec+: { |
| 44 | template+: { |
| 45 | spec+: { |
| 46 | volumes_: { |
| 47 | cas: kube.PersistentVolumeClaimVolume(prod.proxy.pvc), |
| 48 | }, |
| 49 | containers_: { |
| 50 | proxy: kube.Container("proxy") { |
| 51 | image:prod.proxyImage, |
| 52 | command: [ |
| 53 | "/games/factorio/modproxy/modproxy", |
| 54 | "-hspki_disable", |
| 55 | "-cas_directory", "/mnt/cas", |
| 56 | "-listen_address", "0.0.0.0:4200", |
| 57 | ], |
| 58 | volumeMounts_: { |
| 59 | cas: { mountPath: "/mnt/cas" }, |
| 60 | }, |
| 61 | ports_: { |
| 62 | client: { containerPort: 4200 }, |
| 63 | }, |
| 64 | }, |
| 65 | }, |
| 66 | }, |
| 67 | }, |
| 68 | }, |
| 69 | }, |
| 70 | svc: kube.Service("proxy") { |
| 71 | metadata+: { |
| 72 | namespace: "factorio", |
| 73 | }, |
| 74 | target_pod:: prod.proxy.deploy.spec.template, |
| 75 | spec+: { |
| 76 | ports: [ |
| 77 | { name: "client", port: 4200, targetPort: 4200, protocol: "TCP" }, |
| 78 | ], |
| 79 | }, |
| 80 | }, |
| 81 | }, |
| 82 | |
| 83 | local mod = function(name, version) { name: name, version: version }, |
| 84 | |
| 85 | q3k: prod.instance("q3k", "1.0.0-1") { |
| 86 | cfg+: { |
| 87 | mods: [ |
| 88 | mod("Squeak Through", "1.8.0"), |
| 89 | mod("Bottleneck", "0.11.4"), |
| 90 | ], |
| 91 | }, |
| 92 | }, |
| 93 | pymods: prod.instance("pymods", "1.0.0-1") { |
| 94 | cfg+: { |
| 95 | mods: [ |
| 96 | mod("Bottleneck", "0.11.4"), |
| 97 | mod("FARL", "4.0.2"), |
| 98 | mod("Squeak Through", "1.8.0"), |
| 99 | mod("pycoalprocessing", "1.8.3"), |
| 100 | mod("pycoalprocessinggraphics", "1.0.7"), |
| 101 | mod("pyfusionenergy", "1.6.3"), |
| 102 | mod("pyfusionenergygraphics", "1.0.5"), |
| 103 | mod("pyhightech", "1.6.2"), |
| 104 | mod("pyhightechgraphics", "1.0.8"), |
| 105 | mod("pyindustry", "1.4.7"), |
| 106 | mod("pyrawores", "2.1.5"), |
| 107 | mod("pyraworesgraphics", "1.0.4"), |
| 108 | mod("rso-mod", "6.0.11"), |
| 109 | mod("stdlib", "1.4.3"), |
| 110 | mod("what-is-it-really-used-for", "1.5.13"), |
| 111 | ], |
| 112 | }, |
| 113 | }, |
Sergiusz Bazanski | cb5c321 | 2019-05-19 03:10:17 +0200 | [diff] [blame] | 114 | } |