Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve counter and list example comments #3818

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions examples/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ spec:
# [Stage:Beta]
# [FeatureFlag:CountsAndLists]
# Which gameservers in the Fleet are most important to keep around - impacts scale down logic.
# Priority of sorting is in descending importance. I.e. The position 0 `priority` entry is checked first.
# Now in Beta, and enabled by default.
priorities:
- type: Counter # Whether a Counter or a List.
key: rooms # The name of the Counter or List.
order: Ascending # Default is "Ascending" so smaller capacity will be removed first on down scaling.
key: rooms # The name of the Counter or List. No impact if no GameServer found.
order: Ascending # Default is "Ascending" so smaller available capacity will be removed first on down scaling.
- type: List
key: players
order: Ascending
template:
# GameServer metadata
metadata:
Expand All @@ -91,22 +96,14 @@ spec:
# [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
# Now in Beta, and enabled by default.
counters:
players:
count: 9
rooms:
count: 0 # Initial Value. Count and/or capacity must be listed (but may be nil) otherwise the counter will by dropped by the CRD schema.
capacity: 10
sessions:
count: # Count and/or capacity must be listed (but may be nil) otherwise the counter will by dropped by the CRD schema.
lists:
players:
capacity: # Capacity and/or values must be listed (but may be nil) otherwise the list will be dropped by the CRD schema.
rooms:
capacity: 5
values:
- room1
- room2
- room3
# The GameServer's Pod template
template:
spec:
Expand Down
11 changes: 1 addition & 10 deletions examples/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,12 @@ spec:
# 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.
games: # arbitrary key.
rooms: # arbitrary key.
count: 1 # initial value.
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.
sessions:
count: 1
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:
capacity: 333
values: # initial set of values in a list.
- room1
- room2
- room3
#
# Pod template configuration
template:
# pod metadata. Name & Namespace is overwritten
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Guides/counters-and-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ to influence the order in which `GameServers` are shutdown and deleted.


While neither `players` or `rooms` are particularly good examples for this functionality, if we wanted to ensure
that `Ready` `GameServers` with the most available capacity `rooms` where a factor when scaling down a `Fleet` we could
that `Ready` `GameServers` with the most available capacity `rooms` were a factor when scaling down a `Fleet` we could
implement the following:

```yaml
Expand Down
45 changes: 25 additions & 20 deletions site/content/en/docs/Reference/fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ spec:
# Which gameservers in the Fleet are most important to keep around - impacts scale down logic.
# priorities:
# - type: Counter # Sort by a “Counter”
# key: player # The name of the Counter. No impact if no GameServer found.
# order: Descending # Default is "Ascending" so smaller capacity will be removed first on down scaling.
# key: rooms # The name of the Counter. No impact if no GameServer found.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch! Thank you! Got that in the examples.yaml, but not here.

https://github.com/googleforgames/agones/blob/main/examples/fleet.yaml has been updated with the move to beta -- but can we make the descriptions match across both (particularly the "available capacity" addition ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! Changed in 1716e09.

Added the Beta information and made the descriptions in fleet.yaml and fleet.md more consistent.

# order: Descending # Default is "Ascending" so smaller available capacity will be removed first on down scaling.
# - type: List # Sort by a “List”
# key: room # The name of the List. No impact if no GameServer found.
# order: Ascending # Default is "Ascending" so smaller capacity will be removed first on down scaling.
#
# key: players # The name of the List. No impact if no GameServer found.
# order: Ascending # Default is "Ascending" so smaller available capacity will be removed first on down scaling.
#
template:
# GameServer metadata
metadata:
Expand All @@ -84,6 +84,18 @@ spec:
logLevel: Info
grpcPort: 9357
httpPort: 9358
#
# [Stage:Alpha]
# [FeatureFlag:CountsAndLists]
# Counts and Lists provides the configuration for generic (player, room, etc.) tracking features.
# counters:
# rooms:
# count: 0 # Initial Value
# capacity: 10
# lists:
# players:
# values: []
#
# The GameServer's Pod template
template:
spec:
Expand Down Expand Up @@ -135,13 +147,14 @@ spec:
# [Stage:Beta]
# [FeatureFlag:CountsAndLists]
# Which gameservers in the Fleet are most important to keep around - impacts scale down logic.
# Now in Beta, and enabled by default
priorities:
- type: Counter # Sort by a “Counter”
key: player # The name of the Counter. No impact if no GameServer found.
order: Descending # Default is "Ascending" so smaller capacity will be removed first on down scaling.
key: rooms # The name of the Counter. No impact if no GameServer found.
order: Descending # Default is "Ascending" so smaller available capacity will be removed first on down scaling.
- type: List # Sort by a “List”
key: room # The name of the List. No impact if no GameServer found.
order: Ascending # Default is "Ascending" so smaller capacity will be removed first on down scaling.
key: players # The name of the List. No impact if no GameServer found.
order: Ascending # Default is "Ascending" so smaller available capacity will be removed first on down scaling.
template:
# GameServer metadata
metadata:
Expand All @@ -167,20 +180,12 @@ spec:
# Counts and Lists provides the configuration for generic (player, room, session, etc.) tracking features.
# Now in Beta, and enabled by default
counters:
players:
count: 9
rooms:
count: 0 # Initial value
capacity: 10
sessions:
count: # Count and/or capacity must be listed (but may be nil) otherwise the counter will by dropped by the CRD schema.
lists:
players:
capacity: # Capacity and/or values must be listed (but may be nil) otherwise the list will be dropped by the CRD schema.
rooms:
capacity: 5
values:
- room1
- room2
- room3
values: []
# The GameServer's Pod template
template:
spec:
Expand Down
20 changes: 2 additions & 18 deletions site/content/en/docs/Reference/gameserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,12 @@ spec:
# Counts and Lists provides the configuration for generic (player, room, session, etc.) tracking features.
# Commented out since Alpha, and disabled by default
# counters: # counters are int64 counters that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time.
# games: # arbitrary key.
# rooms: # arbitrary key.
# count: 1 # initial value.
# 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.
# sessions:
# count: 1
# 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:
# capacity: 333
# values: # initial set of values in a list.
# - room1
# - room2
# - room3
#
# Pod template configuration
# {{< k8s-api-version href="#podtemplate-v1-core" >}}
Expand Down Expand Up @@ -198,20 +190,12 @@ spec:
# 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.
games: # arbitrary key.
rooms: # arbitrary key.
count: 1 # initial value.
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.
sessions:
count: 1
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:
capacity: 333
values: # initial set of values in a list.
- room1
- room2
- room3
# Pod template configuration
# {{< k8s-api-version href="#podtemplate-v1-core" >}}
template:
Expand Down
Loading