/
mc-bedrock-server-load.yml
126 lines (121 loc) · 4.59 KB
/
mc-bedrock-server-load.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
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
# Server loaded with an archived world
apiVersion: 'agones.dev/v1'
kind: GameServer
metadata:
generateName: 'mc-bedrock-' # Generates a unique name for GameServer and Pod
spec:
container: mc-server # Minecraft server container name
ports:
- name: mc
# "Dynamic" (default) the system allocates a free hostPort for the gameserver (default 7000-8000), for game clients to connect to
portPolicy: Dynamic
# The name of the container to open the port on. Defaults to the game server container if omitted or empty.
container: mc-server
# the port that is being opened on the game server process
containerPort: 19132
# Bedrock uses UDP to connect players
protocol: UDP
# Health checking for the running game server
health:
# Number of seconds after the container has started before health check is initiated.
initialDelaySeconds: 60
# If the `Health()` function doesn't get called at least once every period (seconds), then
# the game server is not healthy.
periodSeconds: 12
# Minimum consecutive failures for the health probe to be considered failed after having succeeded.
failureThreshold: 5
template:
metadata:
annotations:
agones.dev/sdk-backup: mc-bedrock-6grm6-2021-05-10T04:04:56Z.zip # mc-load will download this archived world from storage
spec:
initContainers:
- name: mc-load
image: saulmaldonado/agones-mc # backup
args:
- load
env:
- name: BUCKET_NAME
value: agones-minecraft-mc-worlds
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name # GameServer name ref for logging
- name: BACKUP_NAME
valueFrom:
fieldRef:
fieldPath: metadata.annotations['agones.dev/sdk-backup'] # ref to agones.dev/sdk-backup to download archived world
- name: VOLUME
value: /data
imagePullPolicy: Always
volumeMounts:
- mountPath: /data # shared vol with mc-server
name: world-vol
containers:
- name: mc-server
image: saulmaldonado/minecraft-bedrock-server # Custom minecraft bedrock server image
imagePullPolicy: Always
env: # Full list of ENV variables at https://github.com/saulmaldonado/docker-minecraft-bedrock-server
- name: EULA
value: "TRUE"
- name: WORLD
value: /data/world.zip # Path to zip world archive. container init script will unzip world into its world dir.
volumeMounts:
- mountPath: /data # shared vol with mc-load and mc-backup
name: world-vol
- name: mc-monitor
image: saulmaldonado/agones-mc
args:
- monitor
env:
- name: INITIAL_DELAY
value: 30s
- name: MAX_ATTEMPTS
value: 5
- name: INTERVAL
value: 10s
- name: TIMEOUT
value: 10s
- name: PORT
value: 19132
- name: EDITION
value: bedrock
imagePullPolicy: Always
- name: mc-backup
image: saulmaldonado/agones-mc # backup
args:
- backup
env:
- name: BUCKET_NAME
value: agones-minecraft-mc-worlds
- name: BACKUP_CRON
value: 0 */6 * * *
- name: INITIAL_DELAY
value: 60s
- name: EDITION
value: bedrock
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name # GameServer ref for naming backup zip files
- name: RCON_PASSWORD
value: minecraft # default rcon password. If provided RCON connection will be used to execute 'save-all' before a backup job.
# Change the rcon password when exposing RCON port outside the pod
imagePullPolicy: Always
volumeMounts:
- mountPath: /data # shared vol with mc-server
name: world-vol
- name: mc-fileserver # fileserver
image: saulmaldonado/agones-mc
args:
- fileserver
env:
- name: VOLUME
value: /data
imagePullPolicy: Always
volumeMounts:
- mountPath: /data # shared vol with mc-server
name: world-vol
volumes:
- name: world-vol # shared vol between containers. will not persist bewteen restarts
emptyDir: {}