Skip to content

Commit

Permalink
Website: A number of corrections in the docs (#1466)
Browse files Browse the repository at this point in the history
Corrected spelling and some missleading phrases.
  • Loading branch information
aLekSer authored Apr 14, 2020
1 parent 37e6fa6 commit 3f51072
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion examples/autoscaler-webhook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The service exposes an endpoint which allows client calls to custom scaling logi

When this endpoint is called, target Replica count gets calculated. If a fleet does not need to scale we return `Scale` equals `false`. Endpoint receives and returns the JSON encoded [`FleetAutoscaleReview`](../../docs/fleetautoscaler_spec.md#webhook-endpoint-specification) every SyncPeriod which is 30 seconds.

Note that scaling up logic is based on the percentage of allocated gameservers in a fleet. If this fraction is more than threshold (i. e. 0.7) than `Scale` parameter in `FleetAutoscaleResponse` is set to `true` and `Replica` value is returned increased by the `scaleFactor` (in this example twice) which results in creating more `Ready` GameServers. If the fraction below the threshold (i. e. 0.3) we decrease the count of gameservers in a fleet. There is a `minReplicasCount` parameters which defined the lower limit of the gameservers number in a Fleet.
Note that scaling up logic is based on the percentage of allocated gameservers in a fleet. If this fraction is more than threshold (i. e. 0.7) then `Scale` parameter in `FleetAutoscaleResponse` is set to `true` and `Replica` value is returned increased by the `scaleFactor` (in this example twice) which results in creating more `Ready` GameServers. If the fraction below the threshold (i. e. 0.3) we decrease the count of gameservers in a fleet. There is a `minReplicasCount` parameters which defined the lower limit of the gameservers number in a Fleet.

To learn how to deploy the fleet to GKE, please see the tutorial [Create a Fleet (Go)](https://agones.dev/site/docs/getting-started/create-fleet/).

Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Advanced/allocator-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ go run examples/allocator-client/main.go --ip ${EXTERNAL_IP} \
--cacert ${TLS_CERT_FILE}
```

If your matchmaker is external to the cluster on which your game servers are hosted, agones-allocator provides the gRPC API to allocate game services using mTLS authentication, which can scale independent to agones controller.
If your matchmaker is external to the cluster on which your game servers are hosted, the `agones-allocator` provides the gRPC API to allocate game services using mTLS authentication, which can scale independently to the Agones controller.
2 changes: 1 addition & 1 deletion site/content/en/docs/Advanced/limiting-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Kubernetes documentation for more details on "requests" and "limits" to both CPU
Since the `GameServer` specification provides a full [`PodSpecTemplate`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#podtemplatespec-v1-core),
we can take advantage of both resource limits and requests in our `GameServer` configurations.

For example, to set a CPU limit on our `GameServer` configuration of 250m/0.25 of a cpu,
For example, to set a CPU limit on our `GameServer` configuration of `250m/0.25` of a CPU,
we could do so as followed:

```yaml
Expand Down
3 changes: 2 additions & 1 deletion site/content/en/docs/Advanced/multi-cluster-allocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ description: >
This feature is in a pre-release state and might change.
{{< /alert >}}

There may be different types of clusters, such as on-premise, and Google Kubernetes Engine (GKE), used by a game to help with the cost saving and availability. For this purpose, Agones provides a mechanism to define priorities on the clusters. Priorities are defined on {{< ghlink href="pkg/apis/multicluster/v1/gameserverallocationpolicy.go" >}}GameServerAllocationPolicy{{< /ghlink >}} agones CRD. A matchmaker can enable the multi-cluster rules on a request and target [agones-allocator]({{< relref "allocator-service.md">}}) endpoint in any of the clusters and get resources allocated on the cluster with the highest priority. If the cluster with the highest priority is overloaded, the allocation request is redirected to the cluster with the next highest priority.
There may be different types of clusters, such as on-premise, and Google Kubernetes Engine (GKE), used by a game to help with the cost-saving and availability.
For this purpose, Agones provides a mechanism to define priorities on the clusters. Priorities are defined on {{< ghlink href="pkg/apis/multicluster/v1/gameserverallocationpolicy.go" >}}GameServerAllocationPolicy{{< /ghlink >}} agones CRD. A matchmaker can enable the multi-cluster rules on a request and target [agones-allocator]({{< relref "allocator-service.md">}}) endpoint in any of the clusters and get resources allocated on the cluster with the highest priority. If the cluster with the highest priority is overloaded, the allocation request is redirected to the cluster with the next highest priority.

The remainder of this article describes how to enable multi-cluster allocation.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ and the [Fleet Autoscaler Specification]({{< relref "../Reference/fleetautoscale

## Autoscaling Concepts

To facilitate autoscaling, we need to combine several piece of concepts and functionality, described below.
To facilitate autoscaling, we need to combine several concepts and functionality, as described below.

### Allocation Scheduling

Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Advanced/service-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Since Agones provides `GameServer` `Pods` with a sidecar container that needs ac
`Pods` are configured with a service account with extra RBAC permissions to ensure that it can read and modify the resources it needs.

Since service accounts apply to all containers in a `Pod`, Agones will automatically overwrite the mounted key for the
service account in the container that is running the dedicate game server in the backing `Pod`. This is done
service account in the container that is running the dedicated game server in the backing `Pod`. This is done
since game server containers are exposed publicly, and generally don't require the extra permissions to access aspects
of the Kubernetes API.

Expand Down
12 changes: 6 additions & 6 deletions site/content/en/docs/Getting Started/create-fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ The following prerequisites are required to create a GameServer:

If you don't have a Kubernetes cluster you can follow [these instructions]({{< ref "/docs/Installation/_index.md" >}}) to create a cluster on Google Kubernetes Engine (GKE), Minikube or Azure Kubernetes Service (AKS), and install Agones.

For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-udp/" >}}simple-udp{{< /ghlink >}} example as the GameServer container. This example is very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information.
For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-udp/" >}}simple-udp{{< /ghlink >}} example as the GameServer container. This example is a very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information.

While not required, you may wish to go through the [Create a Game Server]({{< relref "create-gameserver.md" >}}) quickstart before this one.

## Objectives

- Create a Fleet in Kubernetes using Agones custom resource.
- Scale the Fleet up from it's initial configuration.
- Scale the Fleet up from its initial configuration.
- Request a GameServer allocation from the Fleet to play on.
- Connect to the allocated GameServer.
- Deploy a new GameServer configuration to the Fleet
Expand All @@ -44,8 +44,8 @@ You should see a successful output similar to this :
fleet "simple-udp" created
```

This has created a Fleet record inside Kubernetes, which in turn creates two warm [GameServers]({{< ref "/docs/Reference/gameserver.md" >}}) to
be available to being allocated for usage for a game session.
This has created a Fleet record inside Kubernetes, which in turn creates two warm [GameServers]({{< ref "/docs/Reference/gameserver.md" >}})
that are available to be allocated for a game session.

```
kubectl get fleet
Expand Down Expand Up @@ -154,7 +154,7 @@ players access it (and therefore, it should not be deleted until they are finish
do this through `kubectl` as well, and ask it to return the response in yaml so that we can see what has happened.
{{< /alert >}}

We can do allocation of a GameServer for usage through a `GameServerAllocation`, which will both
We can do the allocation of a GameServer for usage through a `GameServerAllocation`, which will both
return to us the details of a `GameServer` (assuming one is available), and also move it to the `Allocated` state,
which demarcates that it has players on it, and should not be removed until `SDK.Shutdown()` is called, or it is manually deleted.

Expand Down Expand Up @@ -251,7 +251,7 @@ simple-udp-tfqn7-wkb7b Ready 192.168.39.150 7226 minikube 52m
Not only can we scale our fleet up, but we can scale it down as well.
The nice thing about Agones, is that it is smart enough to know when `GameServers` have been moved to `Allocated`
The nice thing about Agones is that it is smart enough to know when `GameServers` have been moved to `Allocated`
and will automatically leave them running on scale down -- as we assume that players are playing on this game server,
and we shouldn't disconnect them!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ You can see the status (able to scale, not limited), the last time the fleet was
and the current and desired fleet size.

The autoscaler works by changing the desired size, and the fleet creates/deletes game server instances
to achieve to that number. The convergence is achieved in time, which is usually measured in seconds.
to achieve that number. The convergence is achieved in time, which is usually measured in seconds.

### 3. Allocate a Game Server from the Fleet

Expand Down Expand Up @@ -260,10 +260,10 @@ If you want to update a `Fleet` which has `RollingUpdate` replacement strategy a
1. With `kubectl apply`: you should omit `replicas` parameter in a `Fleet` Spec before re-applying the `Fleet` configuration.
1. With `kubectl edit`: you should not change the `replicas` parameter in the `Fleet` Spec when updating other field parameters.

If you follow the rules above, then `maxSurge` and `maxUnavaiable` parameters will be used as the RollingUpdate strategy updates your Fleet.
Otherwise the Fleet would be scaled according to Fleet `replicas` parameter first and only after certain amount of time it would be rescaled to fit `FleetAutoscaler` `BufferSize` parameter.
If you follow the rules above, then the `maxSurge` and `maxUnavailable` parameters will be used as the RollingUpdate strategy updates your Fleet.
Otherwise the Fleet would be scaled according to Fleet `replicas` parameter first and only after a certain amount of time it would be rescaled to fit `FleetAutoscaler` `BufferSize` parameter.

You could also check the behaviour of the Fleet with Fleetautoscaler on a test `Fleet` to preview what would occur on your production environment.
You could also check the behaviour of the Fleet with Fleetautoscaler on a test `Fleet` to preview what would occur in your production environment.
{{< /alert >}}

## Next Steps
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Getting Started/create-gameserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The following prerequisites are required to create a GameServer :

If you don't have a Kubernetes cluster you can follow [these instructions]({{< ref "/docs/Installation/_index.md" >}}) to create a cluster on Google Kubernetes Engine (GKE), Minikube or Azure Kubernetes Service (AKS), and install Agones.

For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-udp/" >}}simple-udp{{< /ghlink >}} example as the GameServer container. This example is very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information.
For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-udp/" >}}simple-udp{{< /ghlink >}} example as the GameServer container. This example is a very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information.

### 1. Create a GameServer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ linkTitle: "Create a Webhook Fleetautoscaler"
date: 2019-01-02T06:42:44Z
weight: 40
description: >
This guide covers how you can create webhook fleet autoscaler policy.
This guide covers how you can create a webhook fleet autoscaler policy.
---

In some cases, your game servers may need to use custom logic for scaling your fleet that is more complex that what
In some cases, your game servers may need to use custom logic for scaling your fleet that is more complex than what
can be expressed using the Buffer policy in the fleetautoscaler. This guide shows how you can extend Agones
with an autoscaler webhook to implement a custom autoscaling policy.

Expand All @@ -20,8 +20,7 @@ period (currently 30s) with a JSON body, and scale the target fleet based on the

### Prerequisites

It is assumed that you have read the instructions to [Create a Game Server Fleet]({{< relref "./create-fleet.md" >}})
and you have a running fleet of game servers or you could run command from Step #1.
It is assumed that you have completed the instructions to [Create a Game Server Fleet]({{< relref "./create-fleet.md" >}}) and have a running fleet of game servers.

### Objectives

Expand All @@ -40,7 +39,7 @@ kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< rel

#### 2. Deploy a Webhook service for autoscaling

In this step we would deploy an example webhook which will control the size of the fleet based on allocated gameservers
In this step we would deploy an example webhook that will control the size of the fleet based on allocated gameservers
portion in a fleet. You can see the source code for this example webhook server {{< ghlink href="examples/autoscaler-webhook/main.go" >}}here{{< /ghlink >}}.
The fleetautoscaler would trigger this endpoint every 30 seconds. More details could be found {{< ghlink href="examples/autoscaler-webhook/" >}}also here{{< /ghlink >}}.
We need to create a pod which will handle HTTP requests with json payload
Expand Down Expand Up @@ -138,7 +137,7 @@ Events: <none>

You can see the status (able to scale, not limited), the last time the fleet was scaled (nil for never), current and desired fleet size.

The autoscaler make a query to a webhoook service deployed on step 1 and on response changing the target Replica size, and the fleet creates/deletes game server instances
The autoscaler makes a query to a webhoook service deployed on step 1 and on response changing the target Replica size, and the fleet creates/deletes game server instances
to achieve that number. The convergence is achieved in time, which is usually measured in seconds.

#### 5. Allocate Game Servers from the Fleet to trigger scale up
Expand Down Expand Up @@ -222,11 +221,11 @@ simple-udp-dmkp4-r4qtt Allocated 35.247.13.175 7220 minikube 5m
simple-udp-dmkp4-rsr6n Ready 35.247.13.175 7297 minikube 5m
```

#### 7. Check down scaling using Webhook Autoscaler policy
#### 7. Check downscaling using Webhook Autoscaler policy

Based on our custom webhook deployed earlier, if the fraction of allocated replicas in whole Replicas count would be less that threshold (0.3) than fleet would scale down by scaleFactor, in our example by 2.
Based on our custom webhook deployed earlier, if the fraction of allocated replicas in whole Replicas count would be less than threshold (0.3) then the fleet would scale down by scaleFactor, in our example by 2.

Note that example webhook server have a limitation that it would not decrease fleet replica count under `minReplicasCount`, which is equal to 2.
Note that the example webhook server has a limitation that it would not decrease fleet replica count under `minReplicasCount`, which is equal to 2.

We need to run EXIT command on one gameserver (Use IP address and port of the allocated gameserver from the previous step) in order to decrease the number of allocated gameservers in a fleet (<0.3).
```
Expand Down Expand Up @@ -276,7 +275,7 @@ kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/{{< re
### Objectives

Using TLS and a certificate authority (CA) bundle we can establish trusted communication between Fleetautoscaler and
an HTTPS server running the autoscaling webhook that controls size of the fleet (Replicas count). The certificate of the
an HTTPS server running the autoscaling webhook that controls the size of the fleet (Replicas count). The certificate of the
autoscaling webhook must be signed by the CA provided in fleetautoscaler yaml configuration file. Using TLS eliminates
the possibility of a man-in-the-middle attack between the fleetautoscaler and the autoscaling webhook.

Expand All @@ -289,7 +288,7 @@ kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< rel

#### 2. Create X509 Root and Webhook certificates

The procedure of generating Self-signed CA certificate taken from [here](https://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/)
The procedure of generating a Self-signed CA certificate taken from [here](https://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/)

The first step is to create the private root key:
```
Expand All @@ -301,7 +300,7 @@ The next step is to self-sign this certificate:
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
```

This will start an interactive script which will ask you for various bits of information. Fill it out as you see fit.
This will start an interactive script that will ask you for various bits of information. Fill it out as you see fit.

Every webhook that you wish to install a trusted certificate will need to go through this process. First, just like with the root CA step, you’ll need to create a private key (different from the root CA):
```
Expand Down Expand Up @@ -462,7 +461,7 @@ Error calculating desired fleet size on FleetAutoscaler simple-fleet-r7fdv-autos
```

If you are using a hostname other than `autoscaler-tls-service.default.svc` as the
`Common Name (eg, fully qualified host name)` when creating certificate using `openssl` tool you will see a
`Common Name (eg, fully qualified host name)` when creating a certificate using `openssl` tool you will see a
message like
```
Post https://autoscaler-tls-service.default.svc:8000/scale: x509: certificate is not valid for any names, but wanted to match autoscaler-tls-service.default.svc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ Also complete the "Enabling creation of RBAC resources" and "Installing Agones"
### Modify the simple-udp example source code
Modify the main.go file. For example:

Change main.go line 92:
Change the following line in `main.go`:

From:
```go
ack := "ACK: " + txt + "\n"
respond(conn, sender, "ACK: "+txt+"\n")
```

To:
```go
ack := "ACK: Echo says " + txt + "\n"
respond(conn, sender, "ACK: Echo says "+txt+"\n")
```

### Build Server
Expand Down Expand Up @@ -81,7 +81,7 @@ Modify the following line from gameserver.yaml to use the new configuration.
```
### If using GKE, deploy Server to GKE
Apply the latest settings to kubernetes container.
Apply the latest settings to the Kubernetes container.
```bash
>> gcloud config set container/cluster [CLUSTER_NAME]
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/Guides/Client SDKs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ record that is stored in Kubernetes. To maintain isolation, the `key` value is a
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).
{{< /alert >}}

This can be useful if you want to information from your running game server process to be observable or searchable through the Kubernetes API.
This can be useful if you want information from your running game server process to be observable or searchable through the Kubernetes API.

### SetAnnotation(key, value)

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-"

This can be useful if you want to information from your running game server process to be observable through the Kubernetes API.
This can be useful if you want information from your running game server process to be observable through the Kubernetes API.

### GameServer()

Expand Down
Loading

0 comments on commit 3f51072

Please sign in to comment.