diff --git a/install/helm/agones/templates/crds/gameserver.yaml b/install/helm/agones/templates/crds/gameserver.yaml index 60de48db5a..e4b7ff594b 100644 --- a/install/helm/agones/templates/crds/gameserver.yaml +++ b/install/helm/agones/templates/crds/gameserver.yaml @@ -37,6 +37,12 @@ spec: - name: v1 served: true storage: true + {{- with .Values.gameservers.selectableFields }} + selectableFields: + {{- 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 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 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.