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

Updates to the allocator service tutorial. #930

Merged
merged 2 commits into from
Jul 20, 2019
Merged
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
1 change: 1 addition & 0 deletions examples/allocator-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
FROM golang:1.10.3 as builder

WORKDIR /go/src/agones.dev
# TODO: Clone from the latest release branch instead of from the master branch.
RUN git clone https://github.com/googleforgames/agones.git

WORKDIR /go/src/agones.dev/agones/examples/allocator-service
Expand Down
58 changes: 56 additions & 2 deletions site/content/en/docs/Tutorials/allocator-service-go.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ The type of service we will be learning about could be used by a game client to

To install on GKE, follow the install instructions (if you haven't already) at
[Setting up a Google Kubernetes Engine (GKE) cluster]({{< relref "../Installation/_index.md#setting-up-a-google-kubernetes-engine-gke-cluster" >}}).
Also complete the "Enabling creation of RBAC resources" and "Installing Agones" sets of instructions on the same page.
Also complete the
{{% feature expiryVersion="0.12.0" %}}
"Enabling creation of RBAC resources" and
{{% /feature %}}
"Installing Agones"
{{% feature expiryVersion="0.12.0" %}}
sets of
{{% /feature %}}
instructions on the same page.

While not required, you may wish to review the [Create a Game Server]({{< relref "../Getting Started/create-gameserver.md" >}}),
[Create a Game Server Fleet]({{< relref "../Getting Started/create-fleet.md" >}}), and/or [Edit a Game Server]({{< relref "../Getting Started/edit-first-gameserver-go.md" >}}) quickstarts.
Expand Down Expand Up @@ -131,21 +139,36 @@ Create the [secret](https://kubernetes.io/docs/concepts/configuration/secret/) b
kubectl create secret tls allocatorsecret --cert=/tmp/allocsvc.crt --key=/tmp/allocsvc.key
```

{{% feature expiryVersion="0.12.0" %}}
The output should be something like:
```
secret "allocatorsecret" created
```
{{% /feature %}}
{{% feature publishVersion="0.12.0" %}}
```
secret/allocatorsecret created
```
{{% /feature %}}

The allocatorw3secret will let data be served by the webserver over https.

Create the secret by running this command:
```
kubectl create secret tls allocatorw3secret --cert=/tmp/tls.crt --key=/tmp/tls.key
```

The output should be something like:
{{% feature expiryVersion="0.12.0" %}}
```
secret "allocatorw3secret" created
```
{{% /feature %}}
{{% feature publishVersion="0.12.0" %}}
```
secret/allocatorw3secret created
```
{{% /feature %}}

See that the secrets exist by running:
```
Expand All @@ -171,12 +194,20 @@ kubectl create -f service-account.yaml
```

The output should look like this:
{{% feature expiryVersion="0.12.0" %}}
```
role "fleet-allocator" created
serviceaccount "fleet-allocator" created
rolebinding "fleet-allocator" created
```

{{% /feature %}}
{{% feature publishVersion="0.12.0" %}}
```
role.rbac.authorization.k8s.io/fleet-allocator created
serviceaccount/fleet-allocator created
rolebinding.rbac.authorization.k8s.io/fleet-allocator created
```
{{% /feature %}}

### 6. Define and Deploy the Service
The service definition defines a [nodePort](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport) service which uses https, and sets up ports and names. The deployment describes the number of replicas we would like, which account to use, which image to use, and defines a health check.
Expand All @@ -187,10 +218,19 @@ kubectl create -f allocator-service.yaml
```

The output should look like this:
{{% feature expiryVersion="0.12.0" %}}
```
service "fleet-allocator-backend" created
deployment "fleet-allocator" created
```
{{% /feature %}}
{{% feature publishVersion="0.12.0" %}}
```
service/fleet-allocator-backend created
deployment.apps/fleet-allocator created
```
{{% /feature %}}



### 7. Deploy the Ingress Resource
Expand All @@ -202,9 +242,16 @@ kubectl apply -f allocator-ingress.yaml
```

The output should look like this:
{{% feature expiryVersion="0.12.0" %}}
```
ingress "fleet-allocator-ingress" created
```
{{% /feature %}}
{{% feature publishVersion="0.12.0" %}}
```
ingress.extensions/fleet-allocator-ingress created
```
{{% /feature %}}


### 8. Retrieve the Ephemeral Public IP Address
Expand Down Expand Up @@ -287,9 +334,16 @@ curl -k -u v1GameClientKey:EAEC945C371B2EC361DE399C2F11E https://[the.ip.address
```

The output should show the JSON of the GameServerStatus, similar to this:
{{% feature expiryVersion="0.12.0" %}}
```
{"status":{"state":"Allocated","ports":[{"name":"default","port":7260}],"address":"35.231.204.26","nodeName":"gke-agones-simple-udp-cluste-default-pool-e03a9bde-000f"}}
```
{{% /feature %}}
{{% feature publishVersion="0.12.0" %}}
```
{"status":"Allocated"}
```
{{% /feature %}}

You may need to wait a few moments longer if the output has ssl errors like this:
```
Expand Down