From c2f089db1708ab3ea72ea8c51780c67ed6678401 Mon Sep 17 00:00:00 2001 From: Robert Bailey Date: Sat, 13 Jul 2019 01:00:51 -0700 Subject: [PATCH] Update website docs. --- .../en/docs/Advanced/limiting-resources.md | 22 ++ .../Advanced/scheduling-and-autoscaling.md | 45 ++++ .../en/docs/Advanced/service-accounts.md | 20 ++ site/content/en/docs/Examples/_index.md | 8 + .../en/docs/Getting Started/create-fleet.md | 129 ++++++++- .../docs/Getting Started/create-gameserver.md | 62 +++++ .../en/docs/Guides/Client SDKs/_index.md | 12 + .../content/en/docs/Guides/Client SDKs/cpp.md | 31 +++ .../en/docs/Guides/Client SDKs/rest.md | 10 + site/content/en/docs/Guides/access-api.md | 255 +++++++++++++++--- .../en/docs/Guides/local-game-server.md | 25 ++ site/content/en/docs/Guides/metrics.md | 33 +++ site/content/en/docs/Installation/_index.md | 19 ++ site/content/en/docs/Installation/helm.md | 7 + site/content/en/docs/Reference/fleet.md | 93 +++++++ site/content/en/docs/Reference/gameserver.md | 41 +++ .../en/docs/Reference/gameserverallocation.md | 38 ++- site/static/agones.cast | 4 +- 18 files changed, 810 insertions(+), 44 deletions(-) diff --git a/site/content/en/docs/Advanced/limiting-resources.md b/site/content/en/docs/Advanced/limiting-resources.md index 12a7eeb56a..052c984e91 100644 --- a/site/content/en/docs/Advanced/limiting-resources.md +++ b/site/content/en/docs/Advanced/limiting-resources.md @@ -25,6 +25,7 @@ we can take advantage of both resource limits and requests in our `GameServer` c For example, to set a CPU limit on our `GameServer` configuration of 250m/0.25 of a cpu, we could do so as followed: +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer @@ -43,6 +44,27 @@ spec: limit: cpu: "250m" #this is our limit here ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: GameServer +metadata: + name: "simple-udp" +spec: + ports: + - name: default + containerPort: 7654 + template: + spec: + containers: + - name: simple-udp + image: {{% example-image %}} + resources: + limit: + cpu: "250m" #this is our limit here +``` +{{% /feature %}} If you do not set a limit or request, the default is set my Kubernetes at a 100m CPU request. diff --git a/site/content/en/docs/Advanced/scheduling-and-autoscaling.md b/site/content/en/docs/Advanced/scheduling-and-autoscaling.md index 65d79acfd8..1324673ef3 100644 --- a/site/content/en/docs/Advanced/scheduling-and-autoscaling.md +++ b/site/content/en/docs/Advanced/scheduling-and-autoscaling.md @@ -64,6 +64,7 @@ There are two scheduling strategies for Fleets - each designed for different typ ### Packed +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: Fleet @@ -82,6 +83,28 @@ spec: - name: simple-udp image: {{% example-image %}} ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: Fleet +metadata: + name: simple-udp +spec: + replicas: 100 + scheduling: Packed + template: + spec: + ports: + - containerPort: 7654 + template: + spec: + containers: + - name: simple-udp + image: {{% example-image %}} +``` +{{% /feature %}} + This is the *default* Fleet scheduling strategy. It is designed for dynamic Kubernetes environments, wherein you wish to scale up and down as load increases or decreases, such as in a Cloud environment where you are paying @@ -119,6 +142,7 @@ With the "Packed" strategy, Fleets will remove `Ready` `GameServers` from Nodes ### Distributed +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: Fleet @@ -137,6 +161,27 @@ spec: - name: simple-udp image: {{% example-image %}} ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: Fleet +metadata: + name: simple-udp +spec: + replicas: 100 + scheduling: Distributed + template: + spec: + ports: + - containerPort: 7654 + template: + spec: + containers: + - name: simple-udp + image: {{% example-image %}} +``` +{{% /feature %}} This Fleet scheduling strategy is designed for static Kubernetes environments, such as when you are running Kubernetes on bare metal, and the cluster size rarely changes, if at all. diff --git a/site/content/en/docs/Advanced/service-accounts.md b/site/content/en/docs/Advanced/service-accounts.md index 5912f67ae2..54055b5595 100644 --- a/site/content/en/docs/Advanced/service-accounts.md +++ b/site/content/en/docs/Advanced/service-accounts.md @@ -25,6 +25,7 @@ If needed, you can provide your own service account on the `Pod` specification i For example: +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer @@ -41,6 +42,25 @@ spec: - name: simple-udp image: {{% example-image %}} ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: GameServer +metadata: + generateName: "simple-udp-" +spec: + ports: + - name: default + containerPort: 7654 + template: + spec: + serviceAccountName: my-special-service-account # a custom service account + containers: + - name: simple-udp + image: {{% example-image %}} +``` +{{% /feature %}} If a service account is configured, the mounted key is not overwritten, as it assumed that you want to have full control of the service account and underlying RBAC permissions. \ No newline at end of file diff --git a/site/content/en/docs/Examples/_index.md b/site/content/en/docs/Examples/_index.md index b349737342..b3293e3d6c 100644 --- a/site/content/en/docs/Examples/_index.md +++ b/site/content/en/docs/Examples/_index.md @@ -35,7 +35,15 @@ These are all examples of simple game server implementations, that integrate the ## Building on top of Agones +{{% feature expiryVersion="0.12.0" %}} - {{< ghlink href="examples/allocator-service" >}}Allocator Service{{< /ghlink >}} (Go) - This service provides an example of using the [Agones API](https://godoc.org/agones.dev/agones/pkg/client/clientset/versioned/typed/stable/v1alpha1) to allocate a GameServer from a Fleet, and is used in the [Create an Allocator Service (Go)]({{< ref "/docs/Tutorials/allocator-service-go.md" >}}) tutorial. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +- {{< ghlink href="examples/allocator-service" >}}Allocator Service{{< /ghlink >}} (Go) - + This service provides an example of using the + [Agones API](https://godoc.org/agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1) to allocate a GameServer from a Fleet, + and is used in the [Create an Allocator Service (Go)]({{< ref "/docs/Tutorials/allocator-service-go.md" >}}) tutorial. +{{% /feature %}} diff --git a/site/content/en/docs/Getting Started/create-fleet.md b/site/content/en/docs/Getting Started/create-fleet.md index e57c8c88bc..0f29c9967f 100644 --- a/site/content/en/docs/Getting Started/create-fleet.md +++ b/site/content/en/docs/Getting Started/create-fleet.md @@ -76,6 +76,7 @@ Let's wait for the two `GameServers` to become ready. watch kubectl describe fleet simple-udp ``` +{{% feature expiryVersion="0.12.0" %}} ``` Name: simple-udp Namespace: default @@ -123,6 +124,56 @@ Events: ---- ------ ---- ---- ------- Normal CreatingGameServerSet 13s fleet-controller Created GameServerSet simple-udp-wlqnd ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +``` +Name: simple-udp +Namespace: default +Labels: +Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"agones.dev/v1","kind":"Fleet","metadata":{"annotations":{},"name":"simple-udp","namespace":"default"},"spec":{"replicas":2,... +API Version: agones.dev/v1 +Kind: Fleet +Metadata: + Cluster Name: + Creation Timestamp: 2018-07-01T18:55:35Z + Generation: 1 + Resource Version: 24685 + Self Link: /apis/agones.dev/v1/namespaces/default/fleets/simple-udp + UID: 56710a91-7d60-11e8-b2dd-08002703ef08 +Spec: + Replicas: 2 + Strategy: + Rolling Update: + Max Surge: 25% + Max Unavailable: 25% + Type: RollingUpdate + Template: + Metadata: + Creation Timestamp: + Spec: + Health: + Ports: + Container Port: 7654 + Name: default + Port Policy: Dynamic + Template: + Metadata: + Creation Timestamp: + Spec: + Containers: + Image: {{< example-image >}} + Name: simple-udp + Resources: +Status: + Allocated Replicas: 0 + Ready Replicas: 2 + Replicas: 2 +Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal CreatingGameServerSet 13s fleet-controller Created GameServerSet simple-udp-wlqnd +``` +{{% /feature %}} If you look towards the bottom, you can see there is a section of `Status > Ready Replicas` which will tell you how many `GameServers` are currently in a Ready state. After a short period, there should be 2 `Ready Replicas`. @@ -211,7 +262,7 @@ spec: metadata: {} required: matchLabels: - stable.agones.dev/fleet: simple-udp + agones.dev/fleet: simple-udp scheduling: Packed status: address: 192.168.122.152 @@ -273,6 +324,7 @@ For the full details of the YAML file head to the [Fleet Specification Guide]({{ You should get back a response that looks like the following: +{{% feature expiryVersion="0.12.0" %}} ``` apiVersion: stable.agones.dev/v1alpha1 kind: FleetAllocation @@ -345,6 +397,81 @@ status: port: 7604 state: Allocated ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +``` +apiVersion: agones.dev/v1 +kind: FleetAllocation +metadata: + clusterName: "" + creationTimestamp: 2018-07-01T18:56:31Z + generateName: simple-udp- + generation: 1 + name: simple-udp-l7dn9 + namespace: default + ownerReferences: + - apiVersion: agones.dev/v1 + blockOwnerDeletion: true + controller: true + kind: GameServer + name: simple-udp-wlqnd-s2xr5 + uid: 5676a611-7d60-11e8-b2dd-08002703ef08 + resourceVersion: "24719" + selfLink: /apis/agones.dev/v1/namespaces/default/fleetallocations/simple-udp-l7dn9 + uid: 77c22f17-7d60-11e8-b2dd-08002703ef08 +spec: + fleetName: simple-udp +status: + GameServer: + metadata: + creationTimestamp: 2018-07-01T18:55:35Z + finalizers: + - agones.dev + generateName: simple-udp-wlqnd- + generation: 1 + labels: + agones.dev/gameserverset: simple-udp-wlqnd + name: simple-udp-wlqnd-s2xr5 + namespace: default + ownerReferences: + - apiVersion: agones.dev/v1 + blockOwnerDeletion: true + controller: true + kind: GameServerSet + name: simple-udp-wlqnd + uid: 56731f1a-7d60-11e8-b2dd-08002703ef08 + resourceVersion: "24716" + selfLink: /apis/agones.dev/v1/namespaces/default/gameservers/simple-udp-wlqnd-s2xr5 + uid: 5676a611-7d60-11e8-b2dd-08002703ef08 + spec: + container: simple-udp + health: + failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 5 + ports: + - containerPort: 7654 + hostPort: 7604 + name: default + portPolicy: Dynamic + protocol: UDP + template: + metadata: + creationTimestamp: null + spec: + containers: + - image: {{< example-image >}} + name: simple-udp + resources: {} + status: + address: 192.168.99.100 + nodeName: agones + ports: + - name: default + port: 7604 + state: Allocated +``` +{{% /feature %}} If you see the `status` section, you should see that there is a `GameServer`, and if you look at its `status > state` value, you can also see that it has been moved to `Allocated`. This means you have been successfully diff --git a/site/content/en/docs/Getting Started/create-gameserver.md b/site/content/en/docs/Getting Started/create-gameserver.md index b27439cd79..354071c801 100644 --- a/site/content/en/docs/Getting Started/create-gameserver.md +++ b/site/content/en/docs/Getting Started/create-gameserver.md @@ -73,6 +73,7 @@ Let's wait for the GameServer state to become `Ready`: watch kubectl describe gameserver ``` +{{% feature expiryVersion="0.12.0" %}} ``` Name: simple-udp-7pjrq Namespace: default @@ -131,6 +132,67 @@ Events: Normal Scheduled 34s gameserver-controller Address and port populated Normal Ready 27s gameserver-controller SDK.Ready() executed ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +``` +Name: simple-udp-7pjrq +Namespace: default +Labels: +Annotations: agones.dev/sdk-version: 0.9.0-764fa53 +API Version: agones.dev/v1 +Kind: GameServer +Metadata: + Creation Timestamp: 2019-02-27T15:06:20Z + Finalizers: + agones.dev + Generate Name: simple-udp- + Generation: 1 + Resource Version: 30377 + Self Link: /apis/agones.dev/v1/namespaces/default/gameservers/simple-udp-7pjrq + UID: 3d7ac3e1-3aa1-11e9-a4f5-42010a8a0019 +Spec: + Container: simple-udp + Health: + Failure Threshold: 3 + Initial Delay Seconds: 5 + Period Seconds: 5 + Ports: + Container Port: 7654 + Host Port: 7190 + Name: default + Port Policy: Dynamic + Protocol: UDP + Scheduling: Packed + Template: + Metadata: + Creation Timestamp: + Spec: + Containers: + Image: {{< example-image >}} + Name: simple-udp + Resources: + Limits: + Cpu: 20m + Memory: 32Mi + Requests: + Cpu: 20m + Memory: 32Mi +Status: + Address: 35.233.183.43 + Node Name: agones + Ports: + Name: default + Port: 7190 + State: Ready +Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal PortAllocation 34s gameserver-controller Port allocated + Normal Creating 34s gameserver-controller Pod simple-udp-7pjrq created + Normal Scheduled 34s gameserver-controller Address and port populated + Normal Ready 27s gameserver-controller SDK.Ready() executed +``` +{{% /feature %}} If you look towards the bottom, you can see there is a `Status > State` value. We are waiting for it to move to `Ready`, which means that the game server is ready to accept connections. diff --git a/site/content/en/docs/Guides/Client SDKs/_index.md b/site/content/en/docs/Guides/Client SDKs/_index.md index 31b842f406..a32a9aab7b 100644 --- a/site/content/en/docs/Guides/Client SDKs/_index.md +++ b/site/content/en/docs/Guides/Client SDKs/_index.md @@ -65,8 +65,14 @@ backing Pod will be deleted, if they have not shut themselves down already. ### SetLabel(key, value) +{{% feature expiryVersion="0.12.0" %}} This will set a [Label](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) value on the backing `GameServer` record that is stored in Kubernetes. To maintain isolation, the `key` value is automatically prefixed with "stable.agones.dev/sdk-" +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +This will set a [Label](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) value on the backing `GameServer` +record that is stored in Kubernetes. To maintain isolation, the `key` value is automatically prefixed with "agones.dev/sdk-" +{{% /feature %}} > Note: There are limits on the characters that be used for label keys and values. Details are [here](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set). @@ -74,8 +80,14 @@ This can be useful if you want to information from your running game server proc ### SetAnnotation(key, value) +{{% feature expiryVersion="0.12.0" %}} This will set a [Annotation](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) value on the backing `Gameserver` record that is stored in Kubernetes. To maintain isolation, the `key` value is automatically prefixed with "stable.agones.dev/sdk-" +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +This will set a [Annotation](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) value on the backing +`Gameserver` record that is stored in Kubernetes. To maintain isolation, the `key` value is automatically prefixed with "agones.dev/sdk-" +{{% /feature %}} This can be useful if you want to information from your running game server process to be observable through the Kubernetes API. diff --git a/site/content/en/docs/Guides/Client SDKs/cpp.md b/site/content/en/docs/Guides/Client SDKs/cpp.md index 3c34ad80d5..99517dddc0 100644 --- a/site/content/en/docs/Guides/Client SDKs/cpp.md +++ b/site/content/en/docs/Guides/Client SDKs/cpp.md @@ -91,12 +91,14 @@ status = sdk->SetAnnotation("test-annotation", "test value"); if (!status.ok()) { ... } ``` +{{% feature expiryVersion="0.12.0" %}} To get the details on the [backing `GameServer`]({{< relref "_index.md#gameserver" >}}) call `sdk->GameServer(&gameserver)`, passing in a `stable::agones::dev::sdk::GameServer*` to push the results of the `GameServer` configuration into. This function will return a grpc::Status object, from which we can call `status.ok()` to determine if the function completed successfully. +{{% feature expiryVersion="0.12.0" %}} ```cpp stable::agones::dev::sdk::GameServer gameserver; grpc::Status status = sdk->GameServer(&gameserver); @@ -116,6 +118,35 @@ sdk->WatchGameServer([](stable::agones::dev::sdk::GameServer gameserver){ std::cout << "GameServer Update, state: " << gameserver.status().state() << std::endl; }); ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +To get the details on the [backing `GameServer`]({{< relref "_index.md#gameserver" >}}) call `sdk->GameServer(&gameserver)`, +passing in a `agones::dev::sdk::GameServer*` to push the results of the `GameServer` configuration into. + +This function will return a grpc::Status object, from which we can call `status.ok()` to determine +if the function completed successfully. + +{{% feature expiryVersion="0.12.0" %}} +```cpp +agones::dev::sdk::GameServer gameserver; +grpc::Status status = sdk->GameServer(&gameserver); +if (!status.ok()) {...} +``` + +To get [updates on the backing `GameServer`]({{< relref "_index.md#watchgameserver-function-gameserver" >}}) as they happen, +call `sdk->WatchGameServer([](agones::dev::sdk::GameServer gameserver){...})`. + +This will call the passed in `std::function` +synchronously (this is a blocking function, so you may want to run it in its own thread) whenever the backing `GameServer` +is updated. + +```cpp +sdk->WatchGameServer([](agones::dev::sdk::GameServer gameserver){ + std::cout << "GameServer Update, name: " << gameserver.object_meta().name() << std::endl; + std::cout << "GameServer Update, state: " << gameserver.status().state() << std::endl; +}); +``` +{{% /feature %}} For more information, you can also read the [SDK Overview]({{< relref "_index.md" >}}), check out {{< ghlink href="sdks/cpp/include/agones/sdk.h" >}}sdk.h{{< /ghlink >}} and also look at the diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index c96a488f74..ea199f519b 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -69,7 +69,12 @@ $ curl -d "{}" -H "Content-Type: application/json" -X POST http://localhost:5935 ### Set Label +{{% feature expiryVersion="0.12.0" %}} Apply a Label with the prefix "stable.agones.dev/sdk-" to the backing `GameServer` metadata. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +Apply a Label with the prefix "agones.dev/sdk-" to the backing `GameServer` metadata. +{{% /feature %}} See the SDK [SetLabel]({{< ref "/docs/Guides/Client SDKs/_index.md#setlabel-key-value" >}}) documentation for restrictions. @@ -81,7 +86,12 @@ $ curl -d '{"key": "foo", "value": "bar"}' -H "Content-Type: application/json" - ### Set Annotation +{{% feature expiryVersion="0.12.0" %}} Apply a Annotation with the prefix "stable.agones.dev/sdk-" to the backing `GameServer` metadata +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +Apply a Annotation with the prefix "agones.dev/sdk-" to the backing `GameServer` metadata +{{% /feature %}} #### Example diff --git a/site/content/en/docs/Guides/access-api.md b/site/content/en/docs/Guides/access-api.md index 6797b7d4d9..a6960534d4 100644 --- a/site/content/en/docs/Guides/access-api.md +++ b/site/content/en/docs/Guides/access-api.md @@ -50,6 +50,7 @@ example from the Kubernetes client. The following is an example of a in-cluster configuration, that creates a `Clientset` for Agones and then creates a `GameServer`. +{{% feature expiryVersion="0.12.0" %}} ```go package main @@ -102,8 +103,63 @@ func main() { fmt.Printf("New game servers' name is: %s", newGS.ObjectMeta.Name) } +``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```go +package main + +import ( + "fmt" + + agonesv1 "agones.dev/agones/pkg/apis/agones/v1" + "agones.dev/agones/pkg/client/clientset/versioned" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/rest" + "k8s.io/client-go/kubernetes" +) + +func main() { + config, err := rest.InClusterConfig() + if err != nil { + logger.WithError(err).Fatal("Could not create in cluster config") + } + + // Access to standard Kubernetes resources through the Kubernetes Clientset + // We don't actually need this for this example, but it's just here for + // illustrative purposes + kubeClient, err := kubernetes.NewForConfig(config) + if err != nil { + logger.WithError(err).Fatal("Could not create the kubernetes clientset") + } + // Access to the Agones resources through the Agones Clientset + // Note that we reuse the same config as we used for the Kubernetes Clientset + agonesClient, err := versioned.NewForConfig(config) + if err != nil { + logger.WithError(err).Fatal("Could not create the agones api clientset") + } + + // Create a GameServer + gs := &agonesv1.GameServer{ObjectMeta: metav1.ObjectMeta{GenerateName: "udp-server", Namespace: "default"}, + Spec: agonesv1.GameServerSpec{ + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{{Name: "udp-server", Image: "{{% example-image %}}"}}, + }, + }, + }, + } + newGS, err := agonesClient.AgonesV1().GameServers("default").Create(gs) + if err != nil { + panic(err) + } + + fmt.Printf("New game servers' name is: %s", newGS.ObjectMeta.Name) +} ``` +{{% /feature %}} ## Direct Access to the REST API via Kubectl @@ -116,6 +172,7 @@ The Kubernetes API can be authenticated and exposed locally through the For example: +{{% feature expiryVersion="0.12.0" %}} ```bash $ kubectl proxy & Starting to serve on 127.0.0.1:8001 @@ -236,7 +293,6 @@ $ curl http://localhost:8001/apis/stable.agones.dev/v1alpha1/namespaces/default/ # allocate a gameserver from a fleet named 'simple-udp', with GameServerAllocation -{{% feature expiryVersion="0.12.0" %}} $ curl -d '{"apiVersion":"allocation.agones.dev/v1alpha1","kind":"GameServerAllocation","spec":{"required":{"matchLabels":{"stable.agones.dev/fleet":"simple-udp"}}}}' -H "Content-Type: application/json" -X POST http://localhost:8001/apis/allocation.agones.dev/v1alpha1/namespaces/default/gameserverallocations { @@ -272,46 +328,7 @@ $ curl -d '{"apiVersion":"allocation.agones.dev/v1alpha1","kind":"GameServerAllo "nodeName": "gke-test-cluster-default-f11755a7-5km3" } } -{{% /feature %}} -{{% feature publishversion="0.12.0" %}} -$ curl -d '{"apiVersion":"allocation.agones.dev/v1","kind":"GameServerAllocation","spec":{"required":{"matchLabels":{"stable.agones.dev/fleet":"simple-udp"}}}}' -H "Content-Type: application/json" -X POST http://localhost:8001/apis/allocation.agones.dev/v1/namespaces/default/gameserverallocations -{ - "kind": "GameServerAllocation", - "apiVersion": "allocation.agones.dev/v1", - "metadata": { - "name": "simple-udp-v6jwb-cmdcv", - "namespace": "default", - "creationTimestamp": "2019-07-03T17:19:47Z" - }, - "spec": { - "multiClusterSetting": { - "policySelector": {} - }, - "required": { - "matchLabels": { - "stable.agones.dev/fleet": "simple-udp" - } - }, - "scheduling": "Packed", - "metadata": {} - }, - "status": { - "state": "Allocated", - "gameServerName": "simple-udp-v6jwb-cmdcv", - "ports": [ - { - "name": "default", - "port": 7445 - } - ], - "address": "34.94.118.237", - "nodeName": "gke-test-cluster-default-f11755a7-5km3" - } -} -{{% /feature %}} - -{{% feature expiryVersion="0.12.0" %}} # allocate a gameserver from a fleet named 'simple-udp', with the deprecated FleetAllocation $ curl -d '{"apiVersion":"stable.agones.dev/v1alpha1","kind":"FleetAllocation","metadata":{"generateName":"simple-udp-", "namespace": "default"},"spec":{"fleetName":"simple-udp"}}' -H "Content-Type: application/json" -X POST http://localhost:8001/apis/stable.agones.dev/v1alpha1/namespaces/default/fleetallocations @@ -417,9 +434,167 @@ $ curl -d '{"apiVersion":"stable.agones.dev/v1alpha1","kind":"FleetAllocation"," } } } +``` {{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```bash +$ kubectl proxy & +Starting to serve on 127.0.0.1:8001 + +# list all Agones endpoints +$ curl http://localhost:8001/apis | grep agones -A 5 -B 5 +... + { + "name": "agones.dev", + "versions": [ + { + "groupVersion": "agones.dev/v1", + "version": "v1" + } + ], + "preferredVersion": { + "groupVersion": "agones.dev/v1", + "version": "v1" + }, + "serverAddressByClientCIDRs": null + } +... + +# List Agones resources +$ curl http://localhost:8001/apis/agones.dev/v1 +{ + "kind": "APIResourceList", + "apiVersion": "v1", + "groupVersion": "agones.dev/v1", + "resources": [ + { + "name": "gameservers", + "singularName": "gameserver", + "namespaced": true, + "kind": "GameServer", + "verbs": [ + "delete", + "deletecollection", + "get", + "list", + "patch", + "create", + "update", + "watch" + ], + "shortNames": [ + "gs" + ] + } + ] +} +# list all gameservers in the default namespace +$ curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/gameservers +{ + "apiVersion": "agones.dev/v1", + "items": [ + { + "apiVersion": "agones.dev/v1", + "kind": "GameServer", + "metadata": { + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"agones.dev/v1\",\"kind\":\"GameServer\",\"metadata\":{\"annotations\":{},\"name\":\"simple-udp\",\"namespace\":\"default\"},\"spec\":{\"containerPort\":7654,\"hostPort\":7777,\"portPolicy\":\"static\",\"template\":{\"spec\":{\"containers\":[{\"image\":\"{{% example-image %}}\",\"name\":\"simple-udp\"}]}}}}\n" + }, + "clusterName": "", + "creationTimestamp": "2018-03-02T21:41:05Z", + "finalizers": [ + "agones.dev" + ], + "generation": 0, + "name": "simple-udp", + "namespace": "default", + "resourceVersion": "760", + "selfLink": "/apis/agones.dev/v1/namespaces/default/gameservers/simple-udp", + "uid": "692beea6-1e62-11e8-beb2-080027637781" + }, + "spec": { + "PortPolicy": "Static", + "container": "simple-udp", + "containerPort": 7654, + "health": { + "failureThreshold": 3, + "initialDelaySeconds": 5, + "periodSeconds": 5 + }, + "hostPort": 7777, + "protocol": "UDP", + "template": { + "metadata": { + "creationTimestamp": null + }, + "spec": { + "containers": [ + { + "image": "{{% example-image %}}", + "name": "simple-udp", + "resources": {} + } + ] + } + } + }, + "status": { + "address": "192.168.99.100", + "nodeName": "agones", + "port": 7777, + "state": "Ready" + } + } + ], + "kind": "GameServerList", + "metadata": { + "continue": "", + "resourceVersion": "1062", + "selfLink": "/apis/agones.dev/v1/namespaces/default/gameservers" + } +} + +# allocate a gameserver from a fleet named 'simple-udp', with GameServerAllocation + +$ curl -d '{"apiVersion":"allocation.agones.dev/v1","kind":"GameServerAllocation","spec":{"required":{"matchLabels":{"agones.dev/fleet":"simple-udp"}}}}' -H "Content-Type: application/json" -X POST http://localhost:8001/apis/allocation.agones.dev/v1/namespaces/default/gameserverallocations + +{ + "kind": "GameServerAllocation", + "apiVersion": "allocation.agones.dev/v1", + "metadata": { + "name": "simple-udp-v6jwb-cmdcv", + "namespace": "default", + "creationTimestamp": "2019-07-03T17:19:47Z" + }, + "spec": { + "multiClusterSetting": { + "policySelector": {} + }, + "required": { + "matchLabels": { + "agones.dev/fleet": "simple-udp" + } + }, + "scheduling": "Packed", + "metadata": {} + }, + "status": { + "state": "Allocated", + "gameServerName": "simple-udp-v6jwb-cmdcv", + "ports": [ + { + "name": "default", + "port": 7445 + } + ], + "address": "34.94.118.237", + "nodeName": "gke-test-cluster-default-f11755a7-5km3" + } +} ``` +{{% /feature %}} + You may wish to review the [Agones Kubernetes API]({{< ref "/docs/Reference/agones_crd_api_reference.html" >}}) for the full data structure reference. diff --git a/site/content/en/docs/Guides/local-game-server.md b/site/content/en/docs/Guides/local-game-server.md index 429f605297..486dff4cf1 100644 --- a/site/content/en/docs/Guides/local-game-server.md +++ b/site/content/en/docs/Guides/local-game-server.md @@ -13,6 +13,7 @@ You can register a local game server with Agones. This means you can run an expe To register your local game server you'll need to know the IP address of the machine running it and the port. With that you'll create a game server config like the one below. +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer @@ -34,6 +35,30 @@ spec: - name: simple-udp image: gcr.io/agones-images/udp-server:0.5 ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: GameServer +metadata: + name: my-local-server + annotations: + # Causes Agones to register your local game server at 192.1.1.2, replace with your server's IP address. + agones.dev/dev-address: "192.1.1.2" +spec: + ports: + - name: default + portPolicy: Static + hostPort: 17654 + containerPort: 17654 + # The following is ignored but required due to validation. + template: + spec: + containers: + - name: simple-udp + image: gcr.io/agones-images/udp-server:0.5 +``` +{{% /feature %}} Once you save this to a file make sure you have `kubectl` configured to point to your Agones cluster and then run `kubectl apply -f dev-gameserver.yaml`. This will register your server with Agones. diff --git a/site/content/en/docs/Guides/metrics.md b/site/content/en/docs/Guides/metrics.md index 7efb798385..fd61f33911 100644 --- a/site/content/en/docs/Guides/metrics.md +++ b/site/content/en/docs/Guides/metrics.md @@ -21,6 +21,7 @@ If you are running a [Prometheus](https://prometheus.io/) instance you just need If you have [Prometheus operator](https://github.com/coreos/prometheus-operator) installed in your cluster, make sure to add a [`ServiceMonitor`](https://github.com/coreos/prometheus-operator/blob/v0.17.0/Documentation/api.md#servicemonitorspec) to discover Agones metrics as shown below: +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -35,6 +36,23 @@ spec: endpoints: - port: web ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: agones + labels: + app: agones +spec: + selector: + matchLabels: + agones.dev/role: controller + endpoints: + - port: web +``` +{{% /feature %}} Finally include that `ServiceMonitor` in your [Prometheus instance CRD](https://github.com/coreos/prometheus-operator/blob/v0.17.0/Documentation/user-guides/getting-started.md#include-servicemonitors), this is usually done by adding a label to the `ServiceMonitor` above that is matched by the prometheus instance of your choice. @@ -120,16 +138,31 @@ and {{< ghlink href="/build/README.md#running-a-test-minikube-cluster" branch="m For resiliency it is recommended to run Prometheus on a dedicated node which is separate from nodes where Game Servers are scheduled. If you use the above command, with our {{< ghlink href="/build/prometheus.yaml" branch="master" >}}prometheus.yaml{{< /ghlink >}} to set up Prometheus, it will schedule Prometheus pods on nodes +{{% feature expiryVersion="0.12.0" %}} tainted with `stable.agones.dev/agones-metrics=true:NoExecute` and labeled with `stable.agones.dev/agones-metrics=true` if available. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +tainted with `agones.dev/agones-metrics=true:NoExecute` and labeled with `agones.dev/agones-metrics=true` if available. +{{% /feature %}} As an example, to set up dedicated node pool for Prometheus on GKE, run the following command before installing Prometheus. Alternatively you can taint and label nodes manually. +{{% feature expiryVersion="0.12.0" %}} ``` gcloud container node-pools create agones-metrics --cluster=... --zone=... \ --node-taints stable.agones.dev/agones-metrics=true:NoExecute \ --node-labels stable.agones.dev/agones-metrics=true \ --num-nodes=1 ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +``` +gcloud container node-pools create agones-metrics --cluster=... --zone=... \ + --node-taints agones.dev/agones-metrics=true:NoExecute \ + --node-labels agones.dev/agones-metrics=true \ + --num-nodes=1 +``` +{{% /feature %}} By default we will disable the push gateway (we don't need it for Agones) and other exporters. diff --git a/site/content/en/docs/Installation/_index.md b/site/content/en/docs/Installation/_index.md index a17f9977f1..71fb21b418 100644 --- a/site/content/en/docs/Installation/_index.md +++ b/site/content/en/docs/Installation/_index.md @@ -8,10 +8,18 @@ description: > In this quickstart, we will create a Kubernetes cluster, and populate it with the resource types that power Agones. +{{% feature expiryVersion="0.12.0" %}} > When running in production, Agones should be scheduled on a dedicated pool of nodes, distinct from where Game Servers > are scheduled for better isolation and resiliency. By default Agones prefers to be scheduled on nodes labeled with > `stable.agones.dev/agones-system=true` and tolerates the node taint `stable.agones.dev/agones-system=true:NoExecute`. > If no dedicated nodes are available, Agones will run on regular nodes. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +> When running in production, Agones should be scheduled on a dedicated pool of nodes, distinct from where Game Servers +> are scheduled for better isolation and resiliency. By default Agones prefers to be scheduled on nodes labeled with +> `agones.dev/agones-system=true` and tolerates the node taint `agones.dev/agones-system=true:NoExecute`. +> If no dedicated nodes are available, Agones will run on regular nodes. +{{% /feature %}} ## Usage Requirements @@ -137,6 +145,7 @@ _Optional_: Create a dedicated node pool for the Agones controllers. If you choo controllers will share the default node pool with your game servers which is fine for kicking the tires but is not recommended for a production deployment. +{{% feature expiryVersion="0.12.0" %}} ```bash gcloud container node-pools create agones-system \ --cluster=[CLUSTER_NAME] \ @@ -144,6 +153,16 @@ gcloud container node-pools create agones-system \ --node-labels stable.agones.dev/agones-system=true \ --num-nodes=1 ``` +{{% /feature %}} +{{% feature publishVersion="0.12.0" %}} +```bash +gcloud container node-pools create agones-system \ + --cluster=[CLUSTER_NAME] \ + --node-taints agones.dev/agones-system=true:NoExecute \ + --node-labels agones.dev/agones-system=true \ + --num-nodes=1 +``` +{{% /feature %}} Flag explanations: diff --git a/site/content/en/docs/Installation/helm.md b/site/content/en/docs/Installation/helm.md index d5e8c39efe..8f0ef22f0b 100644 --- a/site/content/en/docs/Installation/helm.md +++ b/site/content/en/docs/Installation/helm.md @@ -28,9 +28,16 @@ $ helm install --name my-release --namespace agones-system agones/agones _We recommend to install Agones in its own namespaces (like `agones-system` as shown above) you can use the helm `--namespace` parameter to specify a different namespace._ +{{% feature expiryVersion="0.12.0" %}} When running in production, Agones should be scheduled on a dedicated pool of nodes, distinct from where Game Servers are scheduled for better isolation and resiliency. By default Agones prefers to be scheduled on nodes labeled with `stable.agones.dev/agones-system=true` and tolerates node taint `stable.agones.dev/agones-system=true:NoExecute`. If no dedicated nodes are available, Agones will run on regular nodes, but that's not recommended for production use. For instructions on setting up a decidated node pool for Agones, see the [Agones installation instructions]({{< relref "../_index.md" >}}) for your preferred environment. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +When running in production, Agones should be scheduled on a dedicated pool of nodes, distinct from where Game Servers are scheduled for better isolation and resiliency. By default Agones prefers to be scheduled on nodes labeled with `agones.dev/agones-system=true` and tolerates node taint `agones.dev/agones-system=true:NoExecute`. If no dedicated nodes are available, Agones will +run on regular nodes, but that's not recommended for production use. For instructions on setting up a decidated node +pool for Agones, see the [Agones installation instructions]({{< relref "../_index.md" >}}) for your preferred environment. +{{% /feature %}} The command deploys Agones on the Kubernetes cluster with the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. diff --git a/site/content/en/docs/Reference/fleet.md b/site/content/en/docs/Reference/fleet.md index 6a0dfb4474..3996265904 100644 --- a/site/content/en/docs/Reference/fleet.md +++ b/site/content/en/docs/Reference/fleet.md @@ -12,6 +12,7 @@ Like any other Kubernetes resource you describe a `Fleet`'s desired state via a A full `Fleet` specification is available below and in the {{< ghlink href="examples/fleet.yaml" >}}example folder{{< /ghlink >}} for reference : +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: Fleet @@ -43,11 +44,53 @@ spec: - name: example-server image: gcr.io/agones/test-server:0.1 ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: Fleet +metadata: + name: fleet-example +spec: + replicas: 2 + scheduling: Packed + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + template: + metadata: + labels: + foo: bar + spec: + ports: + - name: default + portPolicy: Dynamic + containerPort: 26000 + health: + initialDelaySeconds: 30 + periodSeconds: 60 + template: + spec: + containers: + - name: example-server + image: gcr.io/agones/test-server:0.1 +``` +{{% /feature %}} +{{% feature expiryVersion="0.12.0" %}} Since Agones defines a new [Custom Resources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/) we can define a new resource using the kind `Fleet` with the custom group `stable.agones.dev` and API version `v1alpha1`. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +Since Agones defines a new +[Custom Resources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/) +we can define a new resource using the kind `Fleet` with the custom group `agones.dev` and API +version `v1`. +{{% /feature %}} You can use the metadata field to target a specific [namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) but also @@ -86,6 +129,7 @@ A `FleetAllocation` is used to allocate a `GameServer` out of an existing `Fleet A full `FleetAllocation` specification is available below and in the {{< ghlink href="examples/fleetallocation.yaml" >}}example folder{{< /ghlink >}} for reference: +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: FleetAllocation @@ -99,6 +143,22 @@ spec: annotations: map: garden22 ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: FleetAllocation +metadata: + generateName: fleet-allocation-example- +spec: + fleetName: fleet-example + metadata: + labels: + mode: deathmatch + annotations: + map: garden22 +``` +{{% /feature %}} We recommend using `metadata > generateName`, to declare to Kubernetes that a unique name for the `FleetAllocation` is generated when the `FleetAllocation` is created. @@ -116,12 +176,21 @@ The `spec` field is the actual `FleetAllocation` specification and it is compose Scale subresource is defined for a Fleet. Please refer to [Kubernetes docs](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#subresources). You can use the following command to scale the fleet with name simple-udp: +{{% feature expiryVersion="0.12.0" %}} ```bash $ kubectl scale fleet simple-udp --replicas=10 fleet.stable.agones.dev/simple-udp scaled ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```bash +$ kubectl scale fleet simple-udp --replicas=10 +fleet.agones.dev/simple-udp scaled +``` +{{% /feature %}} You can also use [Kubernetes API]({{< ref "/docs/Guides/access-api.md" >}}) to get or update the Replicas count: +{{% feature expiryVersion="0.12.0" %}} ``` curl http://localhost:8001/apis/stable.agones.dev/v1alpha1/namespaces/default/fleets/simple-udp/scale ... @@ -143,5 +212,29 @@ curl http://localhost:8001/apis/stable.agones.dev/v1alpha1/namespaces/default/fl "replicas": 10 } ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +``` +curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/fleets/simple-udp/scale +... +{ + "kind": "Scale", + "apiVersion": "autoscaling/v1", + "metadata": { + "name": "simple-udp", + "namespace": "default", + "selfLink": "/apis/agones.dev/v1/namespaces/default/fleets/simple-udp/scale", + "uid": "4dfaa310-2566-11e9-afd1-42010a8a0058", + "resourceVersion": "292652", + "creationTimestamp": "2019-01-31T14:41:33Z" + }, + "spec": { + "replicas": 10 + }, + "status": { + "replicas": 10 + } +``` +{{% /feature %}} Also exposing a Scale subresource would allow you to configure HorizontalPodAutoscaler and PodDisruptionBudget for a fleet in the future. However these features have not been tested, and are not currently supported - but if you are looking for these features, please be sure to let us know in the [ticket](https://github.com/googleforgames/agones/issues/553). diff --git a/site/content/en/docs/Reference/gameserver.md b/site/content/en/docs/Reference/gameserver.md index f431f336af..b3e9b02cf2 100644 --- a/site/content/en/docs/Reference/gameserver.md +++ b/site/content/en/docs/Reference/gameserver.md @@ -9,6 +9,7 @@ description: > A full GameServer specification is available below and in the {{< ghlink href="examples/gameserver.yaml" >}}example folder{{< /ghlink >}} for reference : +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer @@ -36,8 +37,43 @@ spec: image: gcr.io/agones/test-server:0.1 imagePullPolicy: Always ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: GameServer +metadata: + name: "gds-example" +spec: + ports: + - name: default + portPolicy: Static + containerPort: 7654 + hostPort: 7777 + protocol: UDP + health: + disabled: false + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 3 + template: + metadata: + labels: + myspeciallabel: myspecialvalue + spec: + containers: + - name: example-server + image: gcr.io/agones/test-server:0.1 + imagePullPolicy: Always +``` +{{% /feature %}} +{{% feature expiryVersion="0.12.0" %}} Since Agones defines a new [Custom Resources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/) we can define a new resource using the kind `GameServer` with the custom group `stable.agones.dev` and API version `v1alpha1`. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +Since Agones defines a new [Custom Resources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/) we can define a new resource using the kind `GameServer` with the custom group `agones.dev` and API version `v1`. +{{% /feature %}} You can use the metadata field to target a specific [namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) but also attach specific [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) and [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to your resource. This is a very common pattern in the Kubernetes ecosystem. @@ -56,7 +92,12 @@ The `spec` field is the actual GameServer specification and it is composed as fo - `containerPort` the port that is being opened on the game server process, this is a required field for `Dynamic` and `Static` port policies, and should not be included in Passthrough configuration. - `protocol` the protocol being used. Defaults to UDP. TCP is the only other option. - `health` to track the overall healthy state of the GameServer, more information available in the [health check documentation]({{< relref "../Guides/health-checking.md" >}}). +{{% feature expiryVersion="0.12.0" %}} - `template` the [pod spec template](https://v1-11.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podtemplatespec-v1-core) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information. +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +- `template` the [pod spec template](https://v1-12.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.12/#podtemplatespec-v1-core) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information. +{{% /feature %}} ## GameServer State Diagram diff --git a/site/content/en/docs/Reference/gameserverallocation.md b/site/content/en/docs/Reference/gameserverallocation.md index babaaf4bc6..496b49f843 100644 --- a/site/content/en/docs/Reference/gameserverallocation.md +++ b/site/content/en/docs/Reference/gameserverallocation.md @@ -10,7 +10,7 @@ weight: 30 A full `GameServerAllocation` specification is available below and in the {{< ghlink href="/examples/gameserverallocation.yaml" >}}example folder{{< /ghlink >}} for reference: - +{{% feature expiryVersion="0.12.0" %}} ```yaml apiVersion: "stable.agones.dev/v1alpha1" kind: GameServerAllocation @@ -44,6 +44,42 @@ spec: annotations: map: garden22 ``` +{{% /feature %}} +{{% feature publishversion="0.12.0" %}} +```yaml +apiVersion: "agones.dev/v1" +kind: GameServerAllocation +metadata: + generateName: simple-udp- +spec: + required: + matchLabels: + game: my-game + matchExpressions: + - {key: tier, operator: In, values: [cache]} + # ordered list of preferred allocations + # This also support `matchExpressions` + preferred: + - matchLabels: + agones.dev/fleet: green-fleet + - matchLabels: + agones.dev/fleet: blue-fleet + # defines how GameServers are organised across the cluster. + # Options include: + # "Packed" (default) is aimed at dynamic Kubernetes clusters, such as cloud providers, wherein we want to bin pack + # resources + # "Distributed" is aimed at static Kubernetes clusters, wherein we want to distribute resources across the entire + # cluster + scheduling: Packed + # Optional custom metadata that is added to the game server at allocation + # You can use this to tell the server necessary session data + metadata: + labels: + mode: deathmatch + annotations: + map: garden22 +``` +{{% /feature %}} We recommend using `metadata > generateName`, to declare to Kubernetes that a unique name for the `GameServerAllocation` is generated when the `GameServerAllocation` is created. diff --git a/site/static/agones.cast b/site/static/agones.cast index 9553d48863..a16b49f379 100644 --- a/site/static/agones.cast +++ b/site/static/agones.cast @@ -29,7 +29,7 @@ [5.890398, "o", "\u001b[?1l\u001b>\u001b[?2004l\r\r\n"] [5.891151, "o", "\u001b]2;kubectl apply -f fleet.yaml\u0007\u001b]1;kubectl\u0007"] [5.891306, "o", "\u001b]133;C;\u0007"] -[6.329093, "o", "fleet.stable.agones.dev/simple-udp created\r\n"] +[6.329093, "o", "fleet.agones.dev/simple-udp created\r\n"] [6.33645, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] [6.337173, "o", "\u001b]2;cyriltovena@Cyrils-MBP: ~\u0007\u001b]1;~\u0007\u001b]133;D;0\u0007\u001b]1337;RemoteHost=cyriltovena@Cyrils-MBP\u0007\u001b]1337;CurrentDir=/Users/ctovena\u0007"] [6.352224, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b]133;A\u0007$ \u001b]133;B\u0007\u001b[K"] @@ -116,7 +116,7 @@ [23.891194, "o", "\r\r\n"] [23.892077, "o", "\u001b]2;kubectl scale fleet simple-udp --replicas=4\u0007\u001b]1;kubectl\u0007"] [23.892276, "o", "\u001b]133;C;\u0007"] -[24.018365, "o", "fleet.stable.agones.dev/simple-udp scaled\r\n"] +[24.018365, "o", "fleet.agones.dev/simple-udp scaled\r\n"] [24.021162, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"] [24.021282, "o", "\u001b]2;cyriltovena@Cyrils-MBP: ~\u0007\u001b]1;~\u0007"] [24.021313, "o", "\u001b]133;D;0\u0007"]