forked from googleforgames/agones
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgameserver.yaml
132 lines (130 loc) · 6.57 KB
/
gameserver.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
---
# Copyright 2017 Google LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Full example of a single Game Server resource
#
# This specifies Game Server specific configuration, but provides
# a Pod Template so that Pod options and capabilities are available.
# This definition sets hostPort + containerPort combo for the game server,
# and provides a sidecar for this game server that the SDK will connect with.
#
#
# For a full reference and details: https://agones.dev/site/docs/reference/gameserver/
#
apiVersion: agones.dev/v1
kind: GameServer
metadata:
# generateName: "gds-example" # generate a unique name, with the given prefix
name: gds-example # set a fixed name
spec:
# if there is more than one container, specify which one is the game server
container: example-server
# Array of ports that can be exposed as direct connections to the game server container
ports:
# name is a descriptive name for the port
- name: default
# [Stage:Alpha]
# [FeatureFlag:PortRanges]
# range is the optional port range name from which to select a port when using a 'Dynamic' or 'Passthrough' port policy.
# Defaults to 'default'.
range: default
# portPolicy has four options:
# - "Dynamic" (default) the system allocates a free hostPort for the gameserver, for game clients to connect to
# - "Static", user defines the hostPort that the game client will connect to. Then onus is on the user to ensure that the
# port is available. When static is the policy specified, `hostPort` is required to be populated
# - "Passthrough" dynamically sets the `containerPort` to the same value as the dynamically selected hostPort.
# This will mean that users will need to lookup what port has been opened through the server side SDK.
# [Stage:Alpha]
# [FeatureFlag:PortPolicyNone]
# - "None" means the `hostPort` is ignored and if defined, the `containerPort` (optional) is used to set the port on the GameServer instance.
portPolicy: Dynamic
# The name of the container to open the port on. Defaults to the game server container if omitted or empty.
container: simple-game-server
# the port that is being opened on the game server process
containerPort: 7654
# the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic".
# hostPort: 7777
# protocol being used. Defaults to UDP. TCP and TCPUDP are other options
protocol: UDP
# Health checking for the running game server
health:
# Disable health checking. defaults to false, but can be set to true
disabled: false
# Number of seconds after the container has started before health check is initiated. Defaults to 5 seconds
initialDelaySeconds: 5
# If the `Health()` function doesn't get called at least once every period (seconds), then
# the game server is not healthy. Defaults to 5
periodSeconds: 5
# Minimum consecutive failures for the health probe to be considered failed after having succeeded.
# Defaults to 3. Minimum value is 1
failureThreshold: 3
# Parameters for game server sidecar
sdkServer:
# sdkServer log level parameter has three options:
# - "Info" (default) The SDK server will output all messages except for debug messages
# - "Debug" The SDK server will output all messages including debug messages
# - "Error" The SDK server will only output error messages
# - "Trace" The SDK server will output all messages, including detailed tracing information
logLevel: Info
# grpcPort and httpPort control what ports the sdkserver listens on.
# Starting with Agones 1.2 the default grpcPort is 9357 and the default
# httpPort is 9358. In earlier releases, the defaults were 59357 and 59358
# respectively but as these were in the ephemeral port range they could
# conflict with other TCP connections.
grpcPort: 9357
httpPort: 9358
# [Stage:Alpha]
# [FeatureFlag:PlayerTracking]
# Players provides the configuration for player tracking features.
# Commented out since Alpha, and disabled by default
# players:
# # set this GameServer's initial player capacity
# initialCapacity: 10
#
# [Stage:Beta]
# [FeatureFlag:CountsAndLists]
# Counts and Lists provides the configuration for generic (player, room, session, etc.) tracking features.
# Now in Beta, and enabled by default
counters: # counters are int64 counters that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time.
rooms: # arbitrary key.
count: 1 # initial value can be set.
capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. See GitHub issue https://github.com/googleforgames/agones/issues/3636 for more details.
lists: # lists are lists of values stored against this GameServer that can be added and deleted from. Keys must be declared at GameServer creation time.
players: # an empty list, with a capacity set to 10.
capacity: 10 # capacity value, defaults to 1000.
rooms: # note that it is allowed to have the same key name with one used in counters
capacity: 333
values: # initial values can also be set for lists
- room1
- room2
- room3
# Pod template configuration
template:
# pod metadata. Name & Namespace is overwritten
metadata:
labels:
myspeciallabel: myspecialvalue
# Pod Specification
spec:
containers:
- name: simple-game-server
image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.35
imagePullPolicy: Always
# nodeSelector is a label that can be used to tell Kubernetes which host
# OS to use. For Windows game servers uncomment the nodeSelector
# definition below.
# Details: https://kubernetes.io/docs/setup/production-environment/windows/user-guide-windows-containers/#ensuring-os-specific-workloads-land-on-the-appropriate-container-host
# nodeSelector:
# kubernetes.io/os: windows