blob: 27dd38d440a9e6ed87f9d5d9a4fee320e48b3aff [file] [log] [blame]
Sergiusz Bazanskicb5c3212019-05-19 03:10:17 +02001local factorio = import "factorio.libsonnet";
Sergiusz Bazanski7fb4acb2019-07-21 17:02:12 +02002local kube = import "../../../../kube/kube.libsonnet";
Sergiusz Bazanskicb5c3212019-05-19 03:10:17 +02003
4
5// Available versions:
Serge Bazanski970b7682020-08-04 20:33:17 +02006// - 0.18.40-1
Serge Bazanski791ab6d2020-08-14 10:34:29 +00007// - 1.0.0-1
Sergiusz Bazanskicb5c3212019-05-19 03:10:17 +02008
9{
10 local prod = self,
11
Sergiusz Bazanski0581bbf2020-05-11 03:21:32 +020012 proxyImage:: "registry.k0.hswaw.net/games/factorio/modproxy:1589157915-eafe7be328477e8a6590c4210466ef12901f1b9a",
13
Sergiusz Bazanskicb5c3212019-05-19 03:10:17 +020014 namespace: kube.Namespace("factorio"),
15 instance(name, tag):: factorio {
16 cfg+: {
17 namespace: "factorio",
18 prefix: name + "-",
19 tag: tag,
Sergiusz Bazanski0581bbf2020-05-11 03:21:32 +020020 proxyImage: prod.proxyImage,
Sergiusz Bazanskicb5c3212019-05-19 03:10:17 +020021 }
22 },
23
Sergiusz Bazanski0581bbf2020-05-11 03:21:32 +020024 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 Bazanskicb5c3212019-05-19 03:10:17 +0200114}