-
Notifications
You must be signed in to change notification settings - Fork 35
/
k8s_openttd.yml
101 lines (99 loc) · 2.15 KB
/
k8s_openttd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
apiVersion: v1
kind: ConfigMap
metadata:
name: openttd-user-config
data:
USER: "daemon"
UID: "1000"
GID: "1000"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: openttd
labels:
app: openttd
spec:
replicas: 1
selector:
matchLabels:
app: openttd
template:
metadata:
labels:
app: openttd
spec:
nodeSelector:
kubernetes.io/hostname: morespace
securityContext:
fsGroup:
valueFrom:
configMapKeyRef:
name: openttd-user-config
key: UID
containers:
- image: bateau/openttd:latest
imagePullPolicy: Always
name: openttd
securityContext:
allowPrivilegeEscalation: false
ports:
- containerPort: 3979
name: openttd-tcp
protocol: TCP
- containerPort: 3979
name: openttd-udp
protocol: UDP
resources:
limits:
cpu: 1000m
memory: 1024Mi
requests:
cpu: 500m
memory: 521Mi
env:
- name: loadgame
value: "exit"
- name: USER
valueFrom:
configMapKeyRef:
name: openttd-user-config
key: USER
- name: PUID
valueFrom:
configMapKeyRef:
name: openttd-user-config
key: UID
- name: PGID
valueFrom:
configMapKeyRef:
name: openttd-user-config
key: GID
volumeMounts:
- name: openttd-config
mountPath: /home/openttd/.openttd
volumes:
- name: openttd-config
hostPath:
path: /home/user/.openttd
---
apiVersion: v1
kind: Service
metadata:
name: openttd
labels:
app: openttd
spec:
selector:
app: openttd
ports:
- name: openttd-tcp
protocol: TCP
port: 3979
targetPort: 3979
- name: openttd-udp
protocol: UDP
port: 3979
targetPort: 3979
sessionAffinity: None
type: NodePort