From 26d9e66b665b4bce0ccac721855ed4a662750170 Mon Sep 17 00:00:00 2001 From: Ermin Hrkalovic Date: Thu, 30 Apr 2026 00:10:49 +0200 Subject: [PATCH 1/4] Add selectable fields to gameserver crd Signed-off-by: Ermin Hrkalovic --- install/helm/agones/templates/crds/gameserver.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/helm/agones/templates/crds/gameserver.yaml b/install/helm/agones/templates/crds/gameserver.yaml index 60de48db5a..9445194a2b 100644 --- a/install/helm/agones/templates/crds/gameserver.yaml +++ b/install/helm/agones/templates/crds/gameserver.yaml @@ -37,6 +37,9 @@ spec: - name: v1 served: true storage: true + selectableFields: + - jsonPath: .status.state + - jsonPath: .status.nodeName additionalPrinterColumns: - jsonPath: .status.state name: State From 01bb3ff888b73b56131852ca483c08a83f084303 Mon Sep 17 00:00:00 2001 From: Ermin Hrkalovic Date: Thu, 30 Apr 2026 00:11:11 +0200 Subject: [PATCH 2/4] run make gen-install Signed-off-by: Ermin Hrkalovic --- install/yaml/install.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/yaml/install.yaml b/install/yaml/install.yaml index 81c2b12967..568e3d45a0 100644 --- a/install/yaml/install.yaml +++ b/install/yaml/install.yaml @@ -7397,6 +7397,9 @@ spec: - name: v1 served: true storage: true + selectableFields: + - jsonPath: .status.state + - jsonPath: .status.nodeName additionalPrinterColumns: - jsonPath: .status.state name: State From 84dcbc010e8bc6955d23375b855a7244f573d367 Mon Sep 17 00:00:00 2001 From: Ermin Hrkalovic Date: Tue, 5 May 2026 22:32:47 +0200 Subject: [PATCH 3/4] make the selectable fields configurable Signed-off-by: Ermin Hrkalovic Co-authored-by: Copilot --- install/helm/agones/templates/crds/gameserver.yaml | 7 +++++-- install/helm/agones/values.yaml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install/helm/agones/templates/crds/gameserver.yaml b/install/helm/agones/templates/crds/gameserver.yaml index 9445194a2b..e4b7ff594b 100644 --- a/install/helm/agones/templates/crds/gameserver.yaml +++ b/install/helm/agones/templates/crds/gameserver.yaml @@ -37,9 +37,12 @@ spec: - name: v1 served: true storage: true + {{- with .Values.gameservers.selectableFields }} selectableFields: - - jsonPath: .status.state - - jsonPath: .status.nodeName + {{- range . }} + - jsonPath: {{ . }} + {{- end }} + {{- end }} additionalPrinterColumns: - jsonPath: .status.state name: State diff --git a/install/helm/agones/values.yaml b/install/helm/agones/values.yaml index 5238953acb..ec9da98dd2 100644 --- a/install/helm/agones/values.yaml +++ b/install/helm/agones/values.yaml @@ -362,6 +362,9 @@ gameservers: # requires feature gate PortRanges to be enabled # game: [9000, 10000] podPreserveUnknownFields: false + selectableFields: + - .status.state + - .status.nodeName lists: maxItems: 1000 From c9170ba667d5bdb836373bae092366deaff5376c Mon Sep 17 00:00:00 2001 From: Ermin Hrkalovic Date: Sat, 9 May 2026 17:52:28 +0200 Subject: [PATCH 4/4] add documentation for new selectable fields Signed-off-by: Ermin Hrkalovic --- .../docs/Installation/Install Agones/helm.md | 19 +++++++++++-------- site/content/en/docs/Reference/gameserver.md | 11 +++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/site/content/en/docs/Installation/Install Agones/helm.md b/site/content/en/docs/Installation/Install Agones/helm.md index 3f01ff82a0..e56bff1f3d 100644 --- a/site/content/en/docs/Installation/Install Agones/helm.md +++ b/site/content/en/docs/Installation/Install Agones/helm.md @@ -390,14 +390,17 @@ The following tables lists the configurable parameters of the Agones chart and t ### GameServers -| Parameter | Description | Default | -| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -| `gameservers.namespaces` | a list of namespaces you are planning to use to deploy game servers | `["default"]` | -| `gameservers.minPort` | Minimum port to use for dynamic port allocation | `7000` | -| `gameservers.maxPort` | Maximum port to use for dynamic port allocation | `8000` | -| `gameservers.additionalPortRanges` | Port ranges from which to do named dynamic port allocation. Example:
additionalPortRanges:
  game: [9000, 10000] | `{}` | -| `gameservers.podPreserveUnknownFields` | Disable [field pruning][pruning] and schema validation on the Pod template for a [GameServer][gameserver] definition | `false` | -| `gameservers.lists.maxItems` | The maximum number of items that can be specified for a list. | `1000` | +| Parameter | Description | Default | +| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------| +| `gameservers.namespaces` | a list of namespaces you are planning to use to deploy game servers | `["default"]` | +| `gameservers.minPort` | Minimum port to use for dynamic port allocation | `7000` | +| `gameservers.maxPort` | Maximum port to use for dynamic port allocation | `8000` | +| `gameservers.additionalPortRanges` | Port ranges from which to do named dynamic port allocation. Example:
additionalPortRanges:
  game: [9000, 10000] | `{}` | +| `gameservers.podPreserveUnknownFields` | Disable [field pruning][pruning] and schema validation on the Pod template for a [GameServer][gameserver] definition | `false` | +{{% feature publishVersion="1.58.0" %}} +| `gameservers.selectableFields` | spec fields available or querying [GameServer][gameserver] resources based | `[".status.state", "status.nodeName"]` | +{{% /feature %}} +| `gameservers.lists.maxItems` | The maximum number of items that can be specified for a list. | `1000` | ### Helm Installation diff --git a/site/content/en/docs/Reference/gameserver.md b/site/content/en/docs/Reference/gameserver.md index 6c8b166c9a..59928f11bc 100644 --- a/site/content/en/docs/Reference/gameserver.md +++ b/site/content/en/docs/Reference/gameserver.md @@ -158,6 +158,17 @@ The `spec` field is the actual GameServer specification and it is composed as fo The GameServer resource does not support updates. If you need to make regular updates to the GameServer spec, consider using a [Fleet]({{< ref "/docs/Reference/fleet.md" >}}). {{% /alert %}} +{{% feature publishVersion="1.58.0" %}} +## Selectable fields + +Agones supports selectable fields for querying `GameServer` resources based on spec field values. This feature enables efficient server-side filtering of `GameServer` resources. + +The following spec fields are available for field selectors in `GameServer` resources: +- status.state - The lifecycle of the `GameServer` (See **GameServer State Diagram**) +- status.nodeName - The node which the `GameServer` is running on + +{{% /feature %}} + ## Sidecar Containers Agones supports the use of [Sidecar Containers](https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/) with exposed ports.