Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Windows containers examples and docs. #2047

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,9 @@ spec:
- name: simple-game-server
image: gcr.io/agones-images/simple-game-server:0.3
imagePullPolicy: Always
# nodeSelector is a label that can be used to tell Kubernetes which host
# OS to use. For Windows game servers uncomment the nodeSelector
# definition below.
# Details: https://kubernetes.io/docs/setup/production-environment/windows/user-guide-windows-containers/#ensuring-os-specific-workloads-land-on-the-appropriate-container-host
# nodeSelector:
# kubernetes.io/os: windows
2 changes: 1 addition & 1 deletion examples/simple-game-server/gameserver-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
generateName: "simple-game-server-"
generateName: "simple-game-server-windows-"
spec:
ports:
- name: default
Expand Down
11 changes: 5 additions & 6 deletions site/content/en/docs/Examples/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ weight: 120
These are full examples for each of the resource types of Agones

- {{< ghlink href="examples/gameserver.yaml" >}}Full GameServer Configuration{{< /ghlink >}}
- {{< ghlink href="examples/gameserver-windows.yaml" >}}Full GameServer Configuration (for Windows){{< /ghlink >}}
jeremyje marked this conversation as resolved.
Show resolved Hide resolved
- {{< ghlink href="examples/fleet.yaml" >}}Full Fleet Configuration{{< /ghlink >}}
- {{< ghlink href="examples/gameserverallocation.yaml" >}}Full GameServer Allocation Configuration{{< /ghlink >}}
- {{< ghlink href="examples/fleetautoscaler.yaml" >}}Full Autoscaler Configuration with Buffer Strategy{{< /ghlink >}}
Expand All @@ -19,25 +18,25 @@ These are full examples for each of the resource types of Agones

## Game server implementations

These are all examples of simple game server implementations, that integrate the Agones game server SDK.
These are all examples of simple game server implementations, that integrate the Agones game server SDK.

* {{< ghlink href="examples/simple-game-server" >}}Simple gameserver{{< /ghlink >}} (Go) - simple server that
* {{< ghlink href="examples/simple-game-server" >}}Simple gameserver{{< /ghlink >}} (Go) - simple server that
responds to TCP connections or UDP packets on the same port.
* {{< ghlink href="examples/cpp-simple" >}}CPP Simple{{< /ghlink >}} (C++) - C++ example that starts up, stays
* {{< ghlink href="examples/cpp-simple" >}}CPP Simple{{< /ghlink >}} (C++) - C++ example that starts up, stays
healthy and then shuts down after 60 seconds.
* {{< ghlink href="examples/nodejs-simple" >}}Node.js Simple{{< /ghlink >}} (Node.js) -
A simple Node.js example that marks itself as ready, sets some labels and then shutsdown.
* {{< ghlink href="examples/rust-simple" >}}Rust Simple{{< /ghlink >}} (Rust) -
A simple Rust example that marks itself as ready, sets some labels and then shutsdown.
* {{< ghlink href="examples/unity-simple" >}}Unity Simple{{< /ghlink >}} (Unity3d) -
This is a very simple "unity server" that doesn't do much other than show how the SDK works in Unity.
* {{< ghlink href="examples/xonotic" >}}Xonotic{{< /ghlink >}} - Wraps the SDK around the open source FPS game
* {{< ghlink href="examples/xonotic" >}}Xonotic{{< /ghlink >}} - Wraps the SDK around the open source FPS game
[Xonotic](http://www.xonotic.org) and hosts it on Agones.
* {{< ghlink href="examples/supertuxkart" >}}SuperTuxKart{{< /ghlink >}} \- Wraps the SDK around the open source
racing game [SuperTuxKart](https://supertuxkart.net/), and hosts it on Agones.

## Building on top of Agones

- {{< ghlink href="examples/crd-client" >}}Agones API Usage Example{{< /ghlink >}} (Go) -
- {{< ghlink href="examples/crd-client" >}}Agones API Usage Example{{< /ghlink >}} (Go) -
This service provides an example of using the [Agones API](https://pkg.go.dev/agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1)
to create a GameServer.
12 changes: 8 additions & 4 deletions site/content/en/docs/Getting Started/create-gameserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linkTitle: "Create a Game Server"
date: 2019-01-02T06:35:31Z
weight: 10
description: >
This guide covers how you can quickly get started using Agones to create GameServers.
This guide covers how you can quickly get started using Agones to create GameServers.
---

## Objectives
Expand All @@ -30,9 +30,15 @@ For the purpose of this guide we're going to use the {{< ghlink href="examples/s

Let's create a GameServer using the following command :

{{% feature publishVersion="1.14.0" %}}
```
# Linux Game Server
jeremyje marked this conversation as resolved.
Show resolved Hide resolved
kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserver.yaml
# Windows Game Server
Copy link
Member

Choose a reason for hiding this comment

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

This is a quickstart -- I'm not sure if we want to mix in the Linux vs Windows container discussion at this point, since this section is more about getting started quickly. WDYT @roberthbailey ?

I would argue it likely makes more sense to have a separate "Windows game server" guide somewhere in the docs, that gives you all the differences required to run Windows containers, and can go into details in depth.

Maybe under Guides ?

Copy link
Member

Choose a reason for hiding this comment

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

@markmandel - does that mean that we should assume that for getting started folks are primarily using linux VMs? If we go that route, we should add a note here with a link to the windows game server guide.

Copy link
Member

Choose a reason for hiding this comment

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

Another thought is that folks may skip this getting started page completely and jump to https://agones.dev/site/docs/getting-started/create-fleet/ which says "While not required, you may wish to go through the Create a Game Server quickstart before this one." Rather than update both the game server and fleet getting started pages to have two paths, having them both link to a guide about windows game servers might be a better flow for users.

kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserver-windows.yaml
```
{{% /feature %}}


You should see a successful output similar to this :

Expand Down Expand Up @@ -174,7 +180,7 @@ If you do not have netcat installed
(i.e. you get a response of `nc: command not found`),
you can install netcat by running `sudo apt install netcat`.

If you are on Windows, you can alternatively install netcat on
If you are on Windows, you can alternatively install netcat on
[WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10),
or download a version of netcat for Windows from [nmap.org](https://nmap.org/ncat/).
{{< /alert >}}
Expand All @@ -194,5 +200,3 @@ If you run `kubectl describe gameserver` again - either the GameServer will be g
## Next Step

If you want to use your own GameServer container make sure you have properly integrated the [Agones SDK]({{< ref "/docs/Guides/Client SDKs/_index.md" >}}).


36 changes: 30 additions & 6 deletions site/content/en/docs/Installation/Creating Cluster/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you prefer using your local shell, you must install the gcloud and kubectl co
To launch Cloud Shell, perform the following steps:

1. Go to [Google Cloud Platform Console][cloud]
1. From the top-right corner of the console, click the
1. From the top-right corner of the console, click the
**Activate Google Cloud Shell** button: ![cloud shell](../../../../images/cloud-shell.png)
1. A Cloud Shell session opens inside a frame at the bottom of the console. Use this shell to run `gcloud` and `kubectl` commands.
1. Set a compute zone in your geographical region with the following command. The compute zone will be something like `us-west1-a`. A full list can be found [here][zones].
Expand Down Expand Up @@ -79,6 +79,13 @@ gcloud container clusters create [CLUSTER_NAME] --cluster-version={{% k8s-versio
--machine-type=n1-standard-4
```

{{% feature publishVersion="1.14.0" %}}
{{< alert title="Note" color="info">}}
jeremyje marked this conversation as resolved.
Show resolved Hide resolved
If you're creating a cluster to run Windows game servers you'll also need to add `--enable-ip-alias`.
jeremyje marked this conversation as resolved.
Show resolved Hide resolved
{{< /alert >}}
{{% /feature %}}

{{% feature publishVersion="1.14.0" %}}
Flag explanations:

* cluster-version: Agones requires Kubernetes version {{% k8s-version %}}.
Expand All @@ -87,6 +94,8 @@ Flag explanations:
* num-nodes: The number of nodes to be created in each of the cluster's zones. Default: 4. Depending on the needs of your game, this parameter should be adjusted.
* no-enable-autoupgrade: Disable automatic upgrades for nodes to reduce the likelihood of in-use games being disrupted.
* machine-type: The type of machine to use for nodes. Default: n1-standard-4. Depending on the needs of your game, you may wish to [have smaller or larger machines](https://cloud.google.com/compute/docs/machine-types).
* enable-ip-alias: Use [Alias IP ranges](https://cloud.google.com/vpc/docs/alias-ip) instead of routes based networking. This is required to create windows node pools.
jeremyje marked this conversation as resolved.
Show resolved Hide resolved
{{% /feature %}}

_Optional_: Create a dedicated node pool for the Agones controllers. If you choose to skip this step, the Agones
controllers will share the default node pool with your game servers which is fine for kicking the tires but is not
Expand Down Expand Up @@ -121,6 +130,21 @@ Flag explanations:
* node-labels: The Kubernetes labels to automatically apply to nodes in this node pool.
* num-nodes: The Agones system controllers only require a single node of capacity to run. For faster recovery time in the event of a node failure, you can increase the size to 2.

{{% feature publishVersion="1.14.0" %}}
_Optional_: Create a dedicated Windows node pool for game servers. If you need to run game servers on Windows you'll
Copy link
Member

Choose a reason for hiding this comment

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

This and the above should be wrapped in a feature shortcode for the next release, since it won't be available until 1.14.0. (https://agones.dev/site/docs/contribute/#within-a-page)

Do we also want to stage windows support somehow? I don't think we can feature flag it, but maybe some docs that it's alpha - as we don't 100% know how well it will perform at this stage?

jeremyje marked this conversation as resolved.
Show resolved Hide resolved
need to create a dedicated node pool for it. Windows Server 2019 (`WINDOWS_LTSC`) is the recommended image for Windows
game servers.

```bash
gcloud container node-pools create windows \
--cluster=[CLUSTER_NAME] \
--no-enable-autoupgrade \
--image-type WINDOWS_LTSC \
--machine-type n1-standard-4 \
--num-nodes=4
```
{{% /feature %}}

Finally, let's tell `gcloud` that we are speaking with this cluster, and get auth credentials for `kubectl` to use.

```bash
Expand All @@ -143,16 +167,16 @@ gcloud compute firewall-rules create game-server-firewall \
```

{{< alert title="Note" color="info">}}
Before planning your production GKE infrastructure, it is worth reviewing the
Before planning your production GKE infrastructure, it is worth reviewing the
[different types of GKE clusters that can be created](https://cloud.google.com/kubernetes-engine/docs/concepts/types-of-clusters),
such as Zonal or Regional, as each has different reliability and cost values, and ensuring this aligns with your
Service Level Objectives or Agreements.
Service Level Objectives or Agreements.

This is particularly true for GKE masters, which can go down temporarily to adjust for cluster resizing,
This is particularly true for a zonal GKE cluster control plane, which can go down temporarily to adjust for cluster resizing,
[automatic upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades) and
[repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs).
[repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs).
{{< /alert >}}

## Next Steps

- Continue to [Install Agones]({{< relref "../Install Agones/_index.md" >}}).
- Continue to [Install Agones]({{< relref "../Install Agones/_index.md" >}}).