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

Update site documentation to reflect firewall prefix and default to Autopilot cluster creation for Agones #3769

Merged
merged 8 commits into from
Apr 24, 2024
Merged
56 changes: 25 additions & 31 deletions site/content/en/docs/Installation/Creating Cluster/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,41 @@ We need a firewall to allow UDP traffic to nodes tagged as `game-server` via por
next section.

```bash
gcloud compute firewall-rules create game-server-firewall \
gcloud compute firewall-rules create gke-agones-game-server-firewall \
vicentefb marked this conversation as resolved.
Show resolved Hide resolved
--allow udp:7000-8000 \
--target-tags game-server \
--description "Firewall to allow game server udp traffic"
```

## Creating the cluster

Create a GKE cluster in which you'll install Agones. You can use
Create a GKE cluster (preferably an Autopilot mode cluster) in which you'll install Agones. You can use
vicentefb marked this conversation as resolved.
Show resolved Hide resolved
[GKE Standard mode](#create-a-standard-mode-cluster-for-agones)
or [GKE Autopilot mode](#create-an-autopilot-mode-cluster-for-agones).

### Create an Autopilot mode cluster for Agones

1. Choose a [Release Channel]({{<ref "/docs/Guides/Best Practices/gke.md#release-channels" >}}) (Autopilot clusters must be on a Release Channel).

1. Create the cluster:

```bash
gcloud container clusters create-auto [CLUSTER_NAME] \
--region=[COMPUTE_REGION] \
--release-channel=[RELEASE_CHANNEL] \
--autoprovisioning-network-tags=game-server
```

Replace the following:
* `[CLUSTER_NAME]`: The name of your cluster.
* `[COMPUTE_REGION]`: the GCP region to create the cluster in.
* `[RELEASE_CHANNEL]`: one of `rapid`, `regular`, or `stable`, chosen [above](#choosing-a-release-channel-and-optional-version). The default is `regular`.

Flag explanations:
* `--region`: The compute region [you chose above](#choosing-a-gke-cluster-mode).
* `--release-channel`: The release channel [you chose above](#choosing-a-release-channel-and-optional-version).
* `--autoprovisioning-network-tags`: Defines the tags that will be attached to new nodes in the cluster. This is to grant access through ports via the [firewall created above](#creating-the-firewall).

### Create a Standard mode cluster for Agones

Create the cluster:
Expand Down Expand Up @@ -292,35 +315,6 @@ Flag explanations:
* `--machine-type`: The type of machine to use for nodes. Default: `e2-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).
* `--num-nodes`: The number of nodes per cluster zone. For regional clusters, `--num-nodes=1` creates one node in 3 separate zones in the region, giving you faster recovery time in the event of a node failure.

### Create an Autopilot mode cluster for Agones

{{<alert title="Note" color="info">}}
These installation instructions apply to Agones 1.30+
{{</alert>}}

1. Choose a [Release Channel]({{<ref "/docs/Guides/Best Practices/gke.md#release-channels" >}}) (Autopilot clusters must be on a Release Channel).

1. Create the cluster:

```bash
gcloud container clusters create-auto [CLUSTER_NAME] \
--region=[COMPUTE_REGION] \
--release-channel=[RELEASE_CHANNEL] \
--autoprovisioning-network-tags=game-server
```

Replace the following:
* `[CLUSTER_NAME]`: The name of your cluster.
* `[COMPUTE_REGION]`: the GCP region to create the cluster in.
* `[RELEASE_CHANNEL]`: one of `rapid`, `regular`, or `stable`, chosen [above](#choosing-a-release-channel-and-optional-version). The default is `regular`.

Flag explanations:
* `--region`: The compute region [you chose above](#choosing-a-gke-cluster-mode).
* `--release-channel`: The release channel [you chose above](#choosing-a-release-channel-and-optional-version).
* `--autoprovisioning-network-tags`: Defines the tags that will be attached to new nodes in the cluster. This is to grant access through ports via the [firewall created above](#creating-the-firewall).



## Setting up cluster credentials

`gcloud container clusters create` configurates credentials for `kubectl` automatically. If you ever lose those, run:
Expand Down
2 changes: 1 addition & 1 deletion site/layouts/shortcodes/gs-prerequisites.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $test := eq (.Get "link_test") "true" | default true }}
<p>The following prerequisites are required to create a GameServer:</p>
<ol>
<li>A Kubernetes cluster with the UDP port range 7000-8000 open on each node.</li>
<li>A Kubernetes cluster with the UDP port range 7000-8000 open on each node. <a href="https://agones.dev/site/docs/installation/creating-cluster/gke/#creating-the-firewall">Creating the firewall</a></li>
Copy link
Member

Choose a reason for hiding this comment

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

This should resolve to either the local or which snapshot version you are seeing - so it can't point at the domain directly.

You can use:

baseURL = "/site/"

As the root of the link, via:

https://gohugo.io/templates/shortcode-templates/#:~:text=Params.shortcode_color).-,%24.Page.Site.Params,-refers%20to%20parameters

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okok sg, i used /site/ now inside the href

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think what @markmandel is saying is that even baseURL could be variable, so you need to use a function here to grab the config.

@markmandel any reason we can't use https://gohugo.io/methods/site/baseurl/ here? I think this just becomes {{ .Site.BaseURL }}docs/installation/creating-cluster/gke/#creating-the-firewall.

<li>Agones controller installed in the targeted cluster</li>
<li>kubectl properly configured</li>
<li>Netcat which is already installed on most Linux/macOS distributions, for windows you can use <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">WSL</a>.</li>
Expand Down
Loading