forked from timche/docker-csgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ar-ffa-deployment.yaml
210 lines (199 loc) · 4.98 KB
/
ar-ffa-deployment.yaml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# apiVersion: v1
# kind: Pod
# metadata:
# name: csgo-test
# labels:
# app: csgo-test
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: csgo-ar-ffa
namespace: csgo
spec:
podManagementPolicy: Parallel
replicas: 1
selector:
matchLabels:
app: csgo-ar-ffa
serviceName: csgo-ar-ffa
template:
metadata:
labels:
app: csgo-ar-ffa
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /metrics
prometheus.io/port: "9273"
spec:
nodeSelector:
node-role.kubernetes.io/csgo: csgo
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- image: npflan/docker-csgo:get5-4.0.8
resources:
requests:
memory: "4G"
cpu: "2"
limits:
cpu: "2"
memory: "4G"
name: csgo
tty: true
stdin: true
ports:
- containerPort: 27015
- containerPort: 27020
env:
- name: CSGO_DISABLE_BOTS
value: "true"
- name: CSGO_HOSTNAME
value: "NPF 2022 - Armsrace - Free For All"
- name: GSLT_URL
value: http://steam-gameserver-token-api.operations/token/730
- name: CSGO_MAX_PLAYERS
value: "10"
# Wingman
- name: CSGO_GAME_MODE
value: "0"
- name: CSGO_GAME_TYPE
value: "1"
- name: CSGO_MAP
value: "de_safehouse"
- name: CSGO_MAP_GROUP
value: "mg_armsrace"
- name: CSGO_IP
value: "0.0.0.0"
- name: CSGO_TICKRATE
value: "64"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CSGO_RCON_PW
valueFrom:
secretKeyRef:
name: csgo
key: rcon-password
- name: CSGO_TV_ENABLE
value: "false"
- name: CSGO_PARAMS
value: "+sv_hibernate_when_empty 0 -conclearlog -condebug -secure"
volumeMounts:
- mountPath: /home/csgo/server
name: csgo-volume
readOnly: true
- mountPath: /scratch
name: csgo-scratch
- image: telegraf:1.20-alpine
name: csgo-metrics
ports:
- containerPort: 9273
resources:
requests:
memory: "100M"
cpu: "100m"
limits:
memory: "100M"
cpu: "100m"
env:
- name: CSGO_IP_PORT
value: "127.0.0.1:27015"
- name: CSGO_RCON_PW
valueFrom:
secretKeyRef:
name: csgo
key: rcon-password
volumeMounts:
- name: csgo-telegraf-config
mountPath: /etc/telegraf/telegraf.conf
subPath: telegraf.conf
readOnly: true
- name: telegraf-cache
mountPath: /.cache
tolerations:
- key: "type"
operator: "Equal"
value: "csgo"
effect: "NoSchedule"
volumes:
- name: telegraf-cache
emptyDir: {}
- name: csgo-scratch
hostPath:
path: /opt/csgo-scratch
type: Directory
- name: csgo-volume
hostPath:
# directory location on host
path: /home/npfuser
# this field is optional
type: Directory
- name: csgo-telegraf-config
configMap:
name: csgo-telegraf-config
items:
- key: telegraf.conf
path: telegraf.conf
---
## Repeat as many times as you need
apiVersion: v1
kind: Service
metadata:
name: csgo-ar-ffa-0
namespace: csgo
spec:
selector:
statefulset.kubernetes.io/pod-name: csgo-ar-ffa-0
ports:
- name: gametcp
protocol: TCP
port: 27015
targetPort: 27015
- name: gameudp
protocol: UDP
port: 27015
targetPort: 27015
- name: matchandhltvtcp
protocol: TCP
port: 27020
targetPort: 27020
- name: matchandhltvudp
protocol: UDP
port: 27020
targetPort: 27020
---
apiVersion: v1
kind: ConfigMap
metadata:
name: csgo-telegraf-config
namespace: csgo
data:
telegraf.conf: |
[agent]
## Default data collection interval for all inputs
interval = "60s"
# [[inputs.tail]]
# files = ["/csgo/csgo/console.log"]
# path_tag = ""
# name_override = "update_available"
# grok_patterns = ["^%{CSGO_MASTER_UPDATE:update:string}$"]
# grok_custom_patterns = '''
# CSGO_UPDATE (?:Your server needs to be restarted in order to receive the latest update.)
# CSGO_MASTER_UPDATE \x03(?:MasterRequestRestart)
# '''
# data_format = "grok"
# [[aggregators.valuecounter]]
# period = "5m"
# drop_original = true
# fields = ["update"]
[[inputs.csgo]]
servers = [
["${CSGO_IP_PORT}", "${CSGO_RCON_PW}"]
]
[[outputs.prometheus_client]]
## Address to listen on.
listen = ":9273"
path = "/metrics"