From 8de9476e7489c8e7ac8f3997305cfb4f2d2badc6 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Fri, 9 Feb 2024 00:47:11 +0000 Subject: [PATCH 1/5] Docs: Default Counter Capacity as 1000 --- examples/counterfleetautoscaler.yaml | 7 ++++--- examples/gameserver.yaml | 2 +- examples/gameserverallocation.yaml | 4 ++-- pkg/apis/allocation/v1/gameserverallocation.go | 4 ++-- sdks/go/alpha.go | 4 +++- site/content/en/docs/Reference/fleet.md | 2 +- site/content/en/docs/Reference/fleetautoscaler.md | 13 +++++++------ site/content/en/docs/Reference/gameserver.md | 4 ++-- .../en/docs/Reference/gameserverallocation.md | 6 +++--- 9 files changed, 25 insertions(+), 21 deletions(-) diff --git a/examples/counterfleetautoscaler.yaml b/examples/counterfleetautoscaler.yaml index 6a301a151c..f20520fd2e 100644 --- a/examples/counterfleetautoscaler.yaml +++ b/examples/counterfleetautoscaler.yaml @@ -38,10 +38,11 @@ spec: # Value can be an absolute number (ex: 5) or a percentage of the Counter available capacity (ex: 5%). # An absolute number is calculated from percentage by rounding up. Must be bigger than 0. Required field. bufferSize: 5 - # MinCapacity is the minimum aggregate Counter total capacity across the fleet. + # MinCapacity is the minimum aggregate Counter total capacity across the fleet, defaulting to 1000. # If BufferSize is specified as a percentage, MinCapacity is required and cannot be 0. # If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize. minCapacity: 10 - # MaxCapacity is the maximum aggregate Counter total capacity across the fleet. - # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. Required field. + # MaxCapacity is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. + # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. + # Setting MaxCapacity to max(int64) may result in issues. Required field. maxCapacity: 100 diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index 62ebf5d00c..3eebdd69bc 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -93,7 +93,7 @@ spec: # 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. # count: 1 # initial value. - # capacity: 100 # (Optional) Maximum value for the counter. 0 is max(int64). + # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # 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. diff --git a/examples/gameserverallocation.yaml b/examples/gameserverallocation.yaml index 540bb6259a..ee80a975ed 100644 --- a/examples/gameserverallocation.yaml +++ b/examples/gameserverallocation.yaml @@ -56,8 +56,8 @@ spec: # rooms: # minCount: 1 # minimum value. Defaults to 0. # maxCount: 5 # maximum value. Defaults to max(int64) - # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 0. - # maxAvailable: 10 # maximum available (current capacity - current count) Defaults to max(int64) + # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 1000. + # maxAvailable: 10 # maximum available (current capacity - current count). Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # lists: # players: # containsValue: "x6k8z" # only match GameServers who has this value in the list. Defaults to "", which is all. diff --git a/pkg/apis/allocation/v1/gameserverallocation.go b/pkg/apis/allocation/v1/gameserverallocation.go index 02b91f7d63..3cfe68a0bd 100644 --- a/pkg/apis/allocation/v1/gameserverallocation.go +++ b/pkg/apis/allocation/v1/gameserverallocation.go @@ -154,10 +154,10 @@ type CounterSelector struct { // MaxCount is the maximum current value. Defaults to 0, which translates as max(in64). // +optional MaxCount int64 `json:"maxCount"` - // MinAvailable specifies the minimum capacity (current capacity - current count) available on a GameServer. Defaults to 0. + // MinAvailable specifies the minimum capacity (current capacity - current count) available on a GameServer. Defaults to 1000. // +optional MinAvailable int64 `json:"minAvailable"` - // MaxAvailable specifies the maximum capacity (current capacity - current count) available on a GameServer. Defaults to 0, which translates to max(int64). + // MaxAvailable specifies the maximum capacity (current capacity - current count) available on a GameServer. Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. // +optional MaxAvailable int64 `json:"maxAvailable"` } diff --git a/sdks/go/alpha.go b/sdks/go/alpha.go index 9851ee7b66..f5d73d2546 100644 --- a/sdks/go/alpha.go +++ b/sdks/go/alpha.go @@ -96,7 +96,9 @@ func (a *Alpha) GetCounterCount(key string) (int64, error) { } // IncrementCounter increases a counter by the given nonnegative integer amount. -// Will execute the increment operation against the current CRD value. Will max at max(int64). +// Will execute the increment operation against the current CRD value. +// By default, the counter's capacity is set to 1000. Attempting to set the capacity +// to max(int64) could lead to issues and is not recommended. // Will error if the key was not predefined in the GameServer resource on creation. // Returns false if the count is at the current capacity (to the latest knowledge of the SDK), // and no increment will occur. diff --git a/site/content/en/docs/Reference/fleet.md b/site/content/en/docs/Reference/fleet.md index 87c0cd9601..62fc8dffe1 100644 --- a/site/content/en/docs/Reference/fleet.md +++ b/site/content/en/docs/Reference/fleet.md @@ -132,7 +132,7 @@ The `spec` field is the actual `Fleet` specification and it is composed as follo - `priorities`: (Alpha, requires `CountsAndLists` feature flag): Defines which gameservers in the Fleet are most important to keep around - impacts scale down logic. - `type`: Sort by a "Counter" or a "List". - `key`: The name of the Counter or List. If not found on the GameServer, has no impact. - - `order`: Order: Sort by “Ascending” or “Descending”. “Descending” a bigger Capacity is preferred. “Ascending” would be smaller Capacity is preferred. + - `order`: Order: Sort by “Ascending” or “Descending”. “Descending” a bigger Capacity is preferred. “Ascending” would be smaller Capacity is preferred. Note that the default Counters capacity is 1000 and setting Counters capacity to max(int64) may lead to issues and is not recommended. - `template` a full `GameServer` configuration template. See the [GameServer]({{< relref "gameserver.md" >}}) reference for all available fields. diff --git a/site/content/en/docs/Reference/fleetautoscaler.md b/site/content/en/docs/Reference/fleetautoscaler.md index 8bec87e42e..c775f2c4f7 100644 --- a/site/content/en/docs/Reference/fleetautoscaler.md +++ b/site/content/en/docs/Reference/fleetautoscaler.md @@ -82,12 +82,13 @@ spec: # Value can be an absolute number (ex: 5) or a percentage of the Counter available capacity (ex: 5%). # An absolute number is calculated from percentage by rounding up. Must be bigger than 0. Required field. bufferSize: 5 - # MinCapacity is the minimum aggregate Counter total capacity across the fleet. + # MinCapacity is the minimum aggregate Counter total capacity across the fleet, defaulting to 1000. # If BufferSize is specified as a percentage, MinCapacity is required and cannot be 0. # If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize. - minCapacity: 10 - # MaxCapacity is the maximum aggregate Counter total capacity across the fleet. - # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. Required field. +minCapacity: 10 + # MaxCapacity is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. + # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. + # Setting MaxCapacity to max(int64) may result in issues. Required field. maxCapacity: 100 ``` @@ -210,8 +211,8 @@ The `spec` field of the `FleetAutoscaler` is composed as follows: - `counter` contains the settings for counter-based autoscaling: - `key` is the name of the counter to use for scaling decisions. - `bufferSize` is the size of a buffer of counted items that are available in the Fleet (available capacity). Value can be an absolute number or a percentage of desired game server instances. An absolute number is calculated from percentage by rounding up. Must be bigger than 0. - - `minCapacity` is the minimum aggregate Counter total capacity across the fleet. If zero, MinCapacity is ignored. If non zero, MinCapacity must be smaller than MaxCapacity and bigger than BufferSize. - - `maxCapacity` is the maximum aggregate Counter total capacity across the fleet. It must be bigger than both MinCapacity and BufferSize. + - `minCapacity` is the minimum aggregate Counter total capacity across the fleet, defaulting to 1000. If zero, MinCapacity is ignored. If non zero, MinCapacity must be smaller than MaxCapacity and bigger than BufferSize. + - `maxCapacity` is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. It must be bigger than both MinCapacity and BufferSize. Note that setting capacity to max(int64) may lead to issues and is not recommended. - `list` parameters of the list policy type - `list` contains the settings for list-based autoscaling: - `key` is the name of the list to use for scaling decisions. diff --git a/site/content/en/docs/Reference/gameserver.md b/site/content/en/docs/Reference/gameserver.md index a478d3cf61..fc125507bd 100644 --- a/site/content/en/docs/Reference/gameserver.md +++ b/site/content/en/docs/Reference/gameserver.md @@ -85,7 +85,7 @@ spec: # 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. # count: 1 # initial value. - # capacity: 100 # (Optional) Maximum value for the counter. 0 is max(int64). + # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # 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. @@ -146,7 +146,7 @@ The `spec` field is the actual GameServer specification and it is composed as fo - `grpcPort` the port that the SDK Server binds to for gRPC connections - `httpPort` the port that the SDK Server binds to for HTTP gRPC gateway connections - `players` (Alpha, behind "PlayerTracking" feature gate), sets this GameServer's initial player capacity -- `counters` (Alpha, requires "CountsAndLists" feature flag) are int64 counters that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time. +- `counters` (Alpha, requires "CountsAndLists" feature flag) are int64 counters with a default capacity of 1000 that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time. Note that setting the capacity to max(int64) may lead to issues - `lists` (Alpha, requires "CountsAndLists" feature flag) are lists of values stored against this GameServer that can be added and deleted from. Key must be declared at GameServer creation time. - `template` the [pod spec template]({{% k8s-api-version href="#podtemplatespec-v1-core" %}}) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information. diff --git a/site/content/en/docs/Reference/gameserverallocation.md b/site/content/en/docs/Reference/gameserverallocation.md index 1142edd48e..613ab21bd3 100644 --- a/site/content/en/docs/Reference/gameserverallocation.md +++ b/site/content/en/docs/Reference/gameserverallocation.md @@ -52,8 +52,8 @@ spec: # rooms: # minCount: 1 # minimum value. Defaults to 0. # maxCount: 5 # maximum value. Defaults to max(int64) - # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 0. - # maxAvailable: 10 # maximum available (current capacity - current count) Defaults to max(int64) + # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 1000. + # maxAvailable: 10 # maximum available (current capacity - current count) . Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # lists: # players: # containsValue: "x6k8z" # only match GameServers who has this value in the list. Defaults to "", which is all. @@ -188,7 +188,7 @@ The `spec` field is the actual `GameServerAllocation` specification, and it is c GameServer via Allocation. Defaults to "Ready". The only other option is "Allocated", which can be used in conjunction with label/annotation/player selectors to retrieve an already Allocated GameServer. - `counters` (Alpha, "CountsAndLists" feature flag) enables filtering based on game server Counter status, such as - the minimum and maximum number of active rooms. This helps in selecting game servers based on their current activity + the minimum and maximum number of active rooms, defaulting to a capacity of 1000. This helps in selecting game servers based on their current activity or capacity. Optional. - `lists` (Alpha, "CountsAndLists" feature flag) enables filtering based on game server List status, such as allowing for inclusion or exclusion of specific players. Optional. From 7d6fa816433aba3778bfbd0d965fdd652d6143da Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Fri, 9 Feb 2024 06:33:10 +0000 Subject: [PATCH 2/5] update docs --- examples/counterfleetautoscaler.yaml | 2 +- examples/gameserver.yaml | 2 +- examples/gameserverallocation.yaml | 4 ++-- pkg/apis/allocation/v1/gameserverallocation.go | 4 ++-- site/content/en/docs/Guides/Client SDKs/_index.md | 2 ++ site/content/en/docs/Reference/fleetautoscaler.md | 2 +- site/content/en/docs/Reference/gameserver.md | 4 ++-- site/content/en/docs/Reference/gameserverallocation.md | 6 +++--- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/counterfleetautoscaler.yaml b/examples/counterfleetautoscaler.yaml index f20520fd2e..f65ff4c994 100644 --- a/examples/counterfleetautoscaler.yaml +++ b/examples/counterfleetautoscaler.yaml @@ -43,6 +43,6 @@ spec: # If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize. minCapacity: 10 # MaxCapacity is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. - # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. + # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. # Setting MaxCapacity to max(int64) may result in issues. Required field. maxCapacity: 100 diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index 3eebdd69bc..db2b8a5d35 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -95,7 +95,7 @@ spec: # count: 1 # initial value. # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # sessions: - # count: 1 + # count: 1 # Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. # 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. diff --git a/examples/gameserverallocation.yaml b/examples/gameserverallocation.yaml index ee80a975ed..76e73f7d65 100644 --- a/examples/gameserverallocation.yaml +++ b/examples/gameserverallocation.yaml @@ -54,8 +54,8 @@ spec: # [FeatureFlag:CountsAndLists] # counters: # selector for counter current values of a GameServer count # rooms: - # minCount: 1 # minimum value. Defaults to 0. - # maxCount: 5 # maximum value. Defaults to max(int64) + # minCount: 1 # minimum value. Defaults to 1000. + # maxCount: 5 # maximum value. Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 1000. # maxAvailable: 10 # maximum available (current capacity - current count). Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # lists: diff --git a/pkg/apis/allocation/v1/gameserverallocation.go b/pkg/apis/allocation/v1/gameserverallocation.go index 3cfe68a0bd..5d006ca73c 100644 --- a/pkg/apis/allocation/v1/gameserverallocation.go +++ b/pkg/apis/allocation/v1/gameserverallocation.go @@ -148,10 +148,10 @@ type PlayerSelector struct { // CounterSelector is the filter options for a GameServer based on the count and/or available capacity. type CounterSelector struct { - // MinCount is the minimum current value. Defaults to 0. + // MinCount is the minimum current value. Defaults to 1000. // +optional MinCount int64 `json:"minCount"` - // MaxCount is the maximum current value. Defaults to 0, which translates as max(in64). + // MaxCount is the maximum current value. Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. // +optional MaxCount int64 `json:"maxCount"` // MinAvailable specifies the minimum capacity (current capacity - current count) available on a GameServer. Defaults to 1000. diff --git a/site/content/en/docs/Guides/Client SDKs/_index.md b/site/content/en/docs/Guides/Client SDKs/_index.md index 2b55cc2a2b..9669b3c492 100644 --- a/site/content/en/docs/Guides/Client SDKs/_index.md +++ b/site/content/en/docs/Guides/Client SDKs/_index.md @@ -264,6 +264,8 @@ to the capacity of that Counter or List. All functions will return an error if the specified `key` is not predefined in the [`GameServer.Spec.Counters`][gameserverspec] resource configuration. +**Note:** For Counters, the default settings for both capacity and count are preset to 1000. It is recommended to avoid configuring the capacity or count to max(int64), as doing so could cause problems with [JSON Patch operations](https://github.com/googleforgames/agones/issues/3636). + ##### Alpha().GetCounterCount(key) This function retrieves either the [`GameServer.Status.Counters[key].Count`][gameserverstatus] or the SDK awaiting-batch diff --git a/site/content/en/docs/Reference/fleetautoscaler.md b/site/content/en/docs/Reference/fleetautoscaler.md index c775f2c4f7..d43649bdb2 100644 --- a/site/content/en/docs/Reference/fleetautoscaler.md +++ b/site/content/en/docs/Reference/fleetautoscaler.md @@ -85,7 +85,7 @@ spec: # MinCapacity is the minimum aggregate Counter total capacity across the fleet, defaulting to 1000. # If BufferSize is specified as a percentage, MinCapacity is required and cannot be 0. # If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize. -minCapacity: 10 + minCapacity: 10 # MaxCapacity is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. # Setting MaxCapacity to max(int64) may result in issues. Required field. diff --git a/site/content/en/docs/Reference/gameserver.md b/site/content/en/docs/Reference/gameserver.md index fc125507bd..44220c40de 100644 --- a/site/content/en/docs/Reference/gameserver.md +++ b/site/content/en/docs/Reference/gameserver.md @@ -87,7 +87,7 @@ spec: # count: 1 # initial value. # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # sessions: - # count: 1 + # count: 1 # Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. # 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. @@ -146,7 +146,7 @@ The `spec` field is the actual GameServer specification and it is composed as fo - `grpcPort` the port that the SDK Server binds to for gRPC connections - `httpPort` the port that the SDK Server binds to for HTTP gRPC gateway connections - `players` (Alpha, behind "PlayerTracking" feature gate), sets this GameServer's initial player capacity -- `counters` (Alpha, requires "CountsAndLists" feature flag) are int64 counters with a default capacity of 1000 that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time. Note that setting the capacity to max(int64) may lead to issues +- `counters` (Alpha, requires "CountsAndLists" feature flag) are int64 counters with a default capacity of 1000 that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time. Note that setting the capacity to max(int64) may lead to issues. - `lists` (Alpha, requires "CountsAndLists" feature flag) are lists of values stored against this GameServer that can be added and deleted from. Key must be declared at GameServer creation time. - `template` the [pod spec template]({{% k8s-api-version href="#podtemplatespec-v1-core" %}}) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information. diff --git a/site/content/en/docs/Reference/gameserverallocation.md b/site/content/en/docs/Reference/gameserverallocation.md index 613ab21bd3..86506e204f 100644 --- a/site/content/en/docs/Reference/gameserverallocation.md +++ b/site/content/en/docs/Reference/gameserverallocation.md @@ -50,10 +50,10 @@ spec: # [FeatureFlag:CountsAndLists] # counters: # selector for counter current values of a GameServer count # rooms: - # minCount: 1 # minimum value. Defaults to 0. - # maxCount: 5 # maximum value. Defaults to max(int64) + # minCount: 1 # minimum value. Defaults to 1000. + # maxCount: 5 # maximum value. Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 1000. - # maxAvailable: 10 # maximum available (current capacity - current count) . Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. + # maxAvailable: 10 # maximum available (current capacity - current count). Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. # lists: # players: # containsValue: "x6k8z" # only match GameServers who has this value in the list. Defaults to "", which is all. From 8b1b4a753886e90c2761bbca37a84219f0bfa5a2 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Fri, 9 Feb 2024 20:10:47 +0000 Subject: [PATCH 3/5] Review changes --- examples/counterfleetautoscaler.yaml | 7 +++---- examples/gameserver.yaml | 4 ++-- examples/gameserverallocation.yaml | 8 ++++---- pkg/apis/allocation/v1/gameserverallocation.go | 8 ++++---- sdks/go/alpha.go | 4 +--- site/content/en/docs/Reference/fleet.md | 2 +- site/content/en/docs/Reference/fleetautoscaler.md | 11 +++++------ site/content/en/docs/Reference/gameserver.md | 4 ++-- .../content/en/docs/Reference/gameserverallocation.md | 10 +++++----- 9 files changed, 27 insertions(+), 31 deletions(-) diff --git a/examples/counterfleetautoscaler.yaml b/examples/counterfleetautoscaler.yaml index f65ff4c994..6a301a151c 100644 --- a/examples/counterfleetautoscaler.yaml +++ b/examples/counterfleetautoscaler.yaml @@ -38,11 +38,10 @@ spec: # Value can be an absolute number (ex: 5) or a percentage of the Counter available capacity (ex: 5%). # An absolute number is calculated from percentage by rounding up. Must be bigger than 0. Required field. bufferSize: 5 - # MinCapacity is the minimum aggregate Counter total capacity across the fleet, defaulting to 1000. + # MinCapacity is the minimum aggregate Counter total capacity across the fleet. # If BufferSize is specified as a percentage, MinCapacity is required and cannot be 0. # If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize. minCapacity: 10 - # MaxCapacity is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. - # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. - # Setting MaxCapacity to max(int64) may result in issues. Required field. + # MaxCapacity is the maximum aggregate Counter total capacity across the fleet. + # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. Required field. maxCapacity: 100 diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index db2b8a5d35..e35e21d3ab 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -93,9 +93,9 @@ spec: # 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. # count: 1 # initial value. - # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. + # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. See [GitHub issue #3636](https://github.com/googleforgames/agones/issues/3636) for more details. # sessions: - # count: 1 # Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. + # 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. diff --git a/examples/gameserverallocation.yaml b/examples/gameserverallocation.yaml index 76e73f7d65..540bb6259a 100644 --- a/examples/gameserverallocation.yaml +++ b/examples/gameserverallocation.yaml @@ -54,10 +54,10 @@ spec: # [FeatureFlag:CountsAndLists] # counters: # selector for counter current values of a GameServer count # rooms: - # minCount: 1 # minimum value. Defaults to 1000. - # maxCount: 5 # maximum value. Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. - # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 1000. - # maxAvailable: 10 # maximum available (current capacity - current count). Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. + # minCount: 1 # minimum value. Defaults to 0. + # maxCount: 5 # maximum value. Defaults to max(int64) + # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 0. + # maxAvailable: 10 # maximum available (current capacity - current count) Defaults to max(int64) # lists: # players: # containsValue: "x6k8z" # only match GameServers who has this value in the list. Defaults to "", which is all. diff --git a/pkg/apis/allocation/v1/gameserverallocation.go b/pkg/apis/allocation/v1/gameserverallocation.go index 5d006ca73c..02b91f7d63 100644 --- a/pkg/apis/allocation/v1/gameserverallocation.go +++ b/pkg/apis/allocation/v1/gameserverallocation.go @@ -148,16 +148,16 @@ type PlayerSelector struct { // CounterSelector is the filter options for a GameServer based on the count and/or available capacity. type CounterSelector struct { - // MinCount is the minimum current value. Defaults to 1000. + // MinCount is the minimum current value. Defaults to 0. // +optional MinCount int64 `json:"minCount"` - // MaxCount is the maximum current value. Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. + // MaxCount is the maximum current value. Defaults to 0, which translates as max(in64). // +optional MaxCount int64 `json:"maxCount"` - // MinAvailable specifies the minimum capacity (current capacity - current count) available on a GameServer. Defaults to 1000. + // MinAvailable specifies the minimum capacity (current capacity - current count) available on a GameServer. Defaults to 0. // +optional MinAvailable int64 `json:"minAvailable"` - // MaxAvailable specifies the maximum capacity (current capacity - current count) available on a GameServer. Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. + // MaxAvailable specifies the maximum capacity (current capacity - current count) available on a GameServer. Defaults to 0, which translates to max(int64). // +optional MaxAvailable int64 `json:"maxAvailable"` } diff --git a/sdks/go/alpha.go b/sdks/go/alpha.go index f5d73d2546..9851ee7b66 100644 --- a/sdks/go/alpha.go +++ b/sdks/go/alpha.go @@ -96,9 +96,7 @@ func (a *Alpha) GetCounterCount(key string) (int64, error) { } // IncrementCounter increases a counter by the given nonnegative integer amount. -// Will execute the increment operation against the current CRD value. -// By default, the counter's capacity is set to 1000. Attempting to set the capacity -// to max(int64) could lead to issues and is not recommended. +// Will execute the increment operation against the current CRD value. Will max at max(int64). // Will error if the key was not predefined in the GameServer resource on creation. // Returns false if the count is at the current capacity (to the latest knowledge of the SDK), // and no increment will occur. diff --git a/site/content/en/docs/Reference/fleet.md b/site/content/en/docs/Reference/fleet.md index 62fc8dffe1..87c0cd9601 100644 --- a/site/content/en/docs/Reference/fleet.md +++ b/site/content/en/docs/Reference/fleet.md @@ -132,7 +132,7 @@ The `spec` field is the actual `Fleet` specification and it is composed as follo - `priorities`: (Alpha, requires `CountsAndLists` feature flag): Defines which gameservers in the Fleet are most important to keep around - impacts scale down logic. - `type`: Sort by a "Counter" or a "List". - `key`: The name of the Counter or List. If not found on the GameServer, has no impact. - - `order`: Order: Sort by “Ascending” or “Descending”. “Descending” a bigger Capacity is preferred. “Ascending” would be smaller Capacity is preferred. Note that the default Counters capacity is 1000 and setting Counters capacity to max(int64) may lead to issues and is not recommended. + - `order`: Order: Sort by “Ascending” or “Descending”. “Descending” a bigger Capacity is preferred. “Ascending” would be smaller Capacity is preferred. - `template` a full `GameServer` configuration template. See the [GameServer]({{< relref "gameserver.md" >}}) reference for all available fields. diff --git a/site/content/en/docs/Reference/fleetautoscaler.md b/site/content/en/docs/Reference/fleetautoscaler.md index d43649bdb2..8bec87e42e 100644 --- a/site/content/en/docs/Reference/fleetautoscaler.md +++ b/site/content/en/docs/Reference/fleetautoscaler.md @@ -82,13 +82,12 @@ spec: # Value can be an absolute number (ex: 5) or a percentage of the Counter available capacity (ex: 5%). # An absolute number is calculated from percentage by rounding up. Must be bigger than 0. Required field. bufferSize: 5 - # MinCapacity is the minimum aggregate Counter total capacity across the fleet, defaulting to 1000. + # MinCapacity is the minimum aggregate Counter total capacity across the fleet. # If BufferSize is specified as a percentage, MinCapacity is required and cannot be 0. # If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize. minCapacity: 10 - # MaxCapacity is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. - # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. - # Setting MaxCapacity to max(int64) may result in issues. Required field. + # MaxCapacity is the maximum aggregate Counter total capacity across the fleet. + # MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. Required field. maxCapacity: 100 ``` @@ -211,8 +210,8 @@ The `spec` field of the `FleetAutoscaler` is composed as follows: - `counter` contains the settings for counter-based autoscaling: - `key` is the name of the counter to use for scaling decisions. - `bufferSize` is the size of a buffer of counted items that are available in the Fleet (available capacity). Value can be an absolute number or a percentage of desired game server instances. An absolute number is calculated from percentage by rounding up. Must be bigger than 0. - - `minCapacity` is the minimum aggregate Counter total capacity across the fleet, defaulting to 1000. If zero, MinCapacity is ignored. If non zero, MinCapacity must be smaller than MaxCapacity and bigger than BufferSize. - - `maxCapacity` is the maximum aggregate Counter total capacity across the fleet, defaulting to 1000. It must be bigger than both MinCapacity and BufferSize. Note that setting capacity to max(int64) may lead to issues and is not recommended. + - `minCapacity` is the minimum aggregate Counter total capacity across the fleet. If zero, MinCapacity is ignored. If non zero, MinCapacity must be smaller than MaxCapacity and bigger than BufferSize. + - `maxCapacity` is the maximum aggregate Counter total capacity across the fleet. It must be bigger than both MinCapacity and BufferSize. - `list` parameters of the list policy type - `list` contains the settings for list-based autoscaling: - `key` is the name of the list to use for scaling decisions. diff --git a/site/content/en/docs/Reference/gameserver.md b/site/content/en/docs/Reference/gameserver.md index 44220c40de..0cf07b5958 100644 --- a/site/content/en/docs/Reference/gameserver.md +++ b/site/content/en/docs/Reference/gameserver.md @@ -85,9 +85,9 @@ spec: # 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. # count: 1 # initial value. - # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. + # capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. See [GitHub issue #3636](https://github.com/googleforgames/agones/issues/3636) for more details. # sessions: - # count: 1 # Defaults to 1000 and setting count to max(int64) may lead to issues and is not recommended. + # 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. diff --git a/site/content/en/docs/Reference/gameserverallocation.md b/site/content/en/docs/Reference/gameserverallocation.md index 86506e204f..1142edd48e 100644 --- a/site/content/en/docs/Reference/gameserverallocation.md +++ b/site/content/en/docs/Reference/gameserverallocation.md @@ -50,10 +50,10 @@ spec: # [FeatureFlag:CountsAndLists] # counters: # selector for counter current values of a GameServer count # rooms: - # minCount: 1 # minimum value. Defaults to 1000. - # maxCount: 5 # maximum value. Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. - # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 1000. - # maxAvailable: 10 # maximum available (current capacity - current count). Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. + # minCount: 1 # minimum value. Defaults to 0. + # maxCount: 5 # maximum value. Defaults to max(int64) + # minAvailable: 1 # minimum available (current capacity - current count). Defaults to 0. + # maxAvailable: 10 # maximum available (current capacity - current count) Defaults to max(int64) # lists: # players: # containsValue: "x6k8z" # only match GameServers who has this value in the list. Defaults to "", which is all. @@ -188,7 +188,7 @@ The `spec` field is the actual `GameServerAllocation` specification, and it is c GameServer via Allocation. Defaults to "Ready". The only other option is "Allocated", which can be used in conjunction with label/annotation/player selectors to retrieve an already Allocated GameServer. - `counters` (Alpha, "CountsAndLists" feature flag) enables filtering based on game server Counter status, such as - the minimum and maximum number of active rooms, defaulting to a capacity of 1000. This helps in selecting game servers based on their current activity + the minimum and maximum number of active rooms. This helps in selecting game servers based on their current activity or capacity. Optional. - `lists` (Alpha, "CountsAndLists" feature flag) enables filtering based on game server List status, such as allowing for inclusion or exclusion of specific players. Optional. From c12909407a0933950fbeb67ccc910f11aed802d9 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Fri, 9 Feb 2024 20:16:55 +0000 Subject: [PATCH 4/5] direct url to the github issue --- examples/gameserver.yaml | 2 +- site/content/en/docs/Reference/gameserver.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index e35e21d3ab..1bcb2c1c83 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -93,7 +93,7 @@ spec: # 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. # 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 #3636](https://github.com/googleforgames/agones/issues/3636) for more details. + # 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. diff --git a/site/content/en/docs/Reference/gameserver.md b/site/content/en/docs/Reference/gameserver.md index 0cf07b5958..635e58b318 100644 --- a/site/content/en/docs/Reference/gameserver.md +++ b/site/content/en/docs/Reference/gameserver.md @@ -85,7 +85,7 @@ spec: # 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. # 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 #3636](https://github.com/googleforgames/agones/issues/3636) for more details. + # 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. From 630912c92c79db17706897fc695c1cb1d1a44aa3 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Mon, 12 Feb 2024 22:21:16 +0000 Subject: [PATCH 5/5] review change --- site/content/en/docs/Guides/Client SDKs/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/en/docs/Guides/Client SDKs/_index.md b/site/content/en/docs/Guides/Client SDKs/_index.md index 9669b3c492..3a4ff378fe 100644 --- a/site/content/en/docs/Guides/Client SDKs/_index.md +++ b/site/content/en/docs/Guides/Client SDKs/_index.md @@ -264,7 +264,7 @@ to the capacity of that Counter or List. All functions will return an error if the specified `key` is not predefined in the [`GameServer.Spec.Counters`][gameserverspec] resource configuration. -**Note:** For Counters, the default settings for both capacity and count are preset to 1000. It is recommended to avoid configuring the capacity or count to max(int64), as doing so could cause problems with [JSON Patch operations](https://github.com/googleforgames/agones/issues/3636). +**Note:** For Counters, the default setting for the capacity is preset to 1000. It is recommended to avoid configuring the capacity to max(int64), as doing so could cause problems with [JSON Patch operations](https://github.com/googleforgames/agones/issues/3636). ##### Alpha().GetCounterCount(key)