Documentation quickstart and specification gameserver#124
Conversation
e157951 to
f444544
Compare
f444544 to
0064ea0
Compare
markmandel
left a comment
There was a problem hiding this comment.
This is awesome.
Still want to run through this and test it, but thought I'd drop a few initial thoughts down before I had a chance to do that.
README.md
Outdated
| ### Guides | ||
| - Integrating the C++ SDK (forthcoming) | ||
| - [Game Server Specification](./docs/gameserver_spec.md) | ||
| - [Integrating the C++ SDK](./docs/integrating_sdk.md) |
There was a problem hiding this comment.
Did you mean to include this line (and the accompanying empty doc?)
Just since there isn't anything in it, I have a minor concern it will get skipped ;)
There was a problem hiding this comment.
I was willing to do it but then time run out. I'll remove it.
There was a problem hiding this comment.
Sounds good. I've got a PR coming where I expand and move the SDK section around a bit, so it should take care of this. It's coming down the pike.
docs/create_gameserver.md
Outdated
|
|
||
| >NOTE: Agones required Kubernetes versions 1.9 with role-based access controls (RBAC) and MutatingAdmissionWebhook features activated. To check your version, enter `kubectl version`. | ||
|
|
||
| If you don't have a Kubernetes cluster you can follow the [build](../build/README.md#running-a-test-minikube-cluster) instructions to either use [Minikube](https://github.com/kubernetes/minikube) single node cluster or create one in [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/). |
There was a problem hiding this comment.
We can update this section once @dzlier-gcp has the new install guide, and redirect to that.
There was a problem hiding this comment.
@dzlier-gcp let me know when it's ready
There was a problem hiding this comment.
actually I referenced it already !
docs/gameserver_spec.md
Outdated
|
|
||
| Like any other kubernetes ressources you describe a GameServer desired state via a specification written in YAML or JSON to the kubernetes API. The Agones controller will then change the actual state to the desired state. | ||
|
|
||
| A full GameServer specification is available below for reference : |
There was a problem hiding this comment.
Shall we also link to the example.yaml in case people want a straight up yaml file as well?
docs/gameserver_spec.md
Outdated
|
|
||
| The `spec` field is the actual GameServer specification and it is composed as follow: | ||
|
|
||
| - `container` is the name of container running the GameServer in case you are running a [multi-container pod](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/) , if you do this is mandatory. For instance this is useful if you want to run a sidecar to ship logs. |
There was a problem hiding this comment.
Rather than saying "multi container" - can we simplify this and say "if you have than one container definied in a pod" (or similar). I think it would be easier to parse.
| Let's wait for the GameServer state to become `Ready`: | ||
|
|
||
| ``` | ||
| watch kubectl describe gameserver |
There was a problem hiding this comment.
Should we put an example in here of what it should look like, and some directions, so the user knows where to look to know that the GameServer is Ready?
(Maybe also direct them to look at some of the events, just as a point of interest?)
There was a problem hiding this comment.
Let me know, wasn't sure what to say
docs/integrating_sdk.md
Outdated
| @@ -0,0 +1 @@ | |||
| # Integrating the C++ SDK No newline at end of file | |||
| metadata: | ||
| name: "simple-udp" | ||
| spec: | ||
| portPolicy: "static" |
There was a problem hiding this comment.
Question: do we want to be explicit about being dynamic? I don't have strong opinions, but thought I'd raise the question.
There was a problem hiding this comment.
I think it's a good point let's do that, if users look at the file at least it is more explanatory
0064ea0 to
ce7c685
Compare
9cf5491 to
671e057
Compare
markmandel
left a comment
There was a problem hiding this comment.
Looking good - some more thoughts and feeling.
| Normal Starting 11s gameserver-controller Synced | ||
| Normal Ready 4s gameserver-controller Address and Port populated | ||
| ``` | ||
|
|
There was a problem hiding this comment.
"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.
You might also be interested to see the Events section, which outlines when various lifecycle events of the GameSever occur. We can also see when the GameServer is ready on the event stream as well - at which time the Status > Address and Status > Port have also been populated, letting us know what IP and port our client can now connect to!
^ Something like that sound good?
There was a problem hiding this comment.
yep changing it.
| Name: simple-udp | ||
| Resources: | ||
| Status: | ||
| Address: 10.130.65.212 |
There was a problem hiding this comment.
Just want to double check this isn't a real IP you care about
There was a problem hiding this comment.
it's internal (10.x.x.x) I don't think anyone can do anything with it. Should I changed that ?
There was a problem hiding this comment.
As long as it's fine. Just wanted to double check. Security FTW.
|
|
||
| 1. A Kubernetes cluster with the UDP port range 7000-8000 open on each node. | ||
| 2. Agones controller installed in the targeted cluster | ||
| 3. kubectl properly configured |
There was a problem hiding this comment.
you're either on WSL or linux I guess you have that no ?
There was a problem hiding this comment.
I'd err on the side of being explicit? And maybe make a note that it's already installed on most Linux/macOS distros, Windows will need to use WSL) ?
| ``` | ||
| user@computer:~/$ gameserver "simple-udp" created | ||
| ``` | ||
|
|
There was a problem hiding this comment.
"This has created a GameServer record inside Kubernetes, which has also created a backing Pod (maybe talk about Pods?) to run our simple udp game server code in"
(I just want to explain a bit more what has happened at each step)
If you want to see all your running GameServers you can run:
kubectl get gameservers
It should look something like this: insert example
(Maybe)
You can also see the Pod that got created by running kubectl get pods, the Pod will be prefixed by simple-udp.
|
|
||
| To install Agones controller into your Kubernetes cluster follow the [installation instructions](../README.md#Installation). | ||
|
|
||
| For the purpose of this guide we're going to use the [simple-udp](../examples/simple-udp/) 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. |
There was a problem hiding this comment.
Do we want to move this up to the top, so we start with what we're trying to achieve?
Otherwise this might get buried in the pre-reqs section.
docs/create_gameserver.md
Outdated
| EXIT | ||
| ``` | ||
|
|
||
| You can also try to send `UNHEALTHY` to change the Game Server state. |
There was a problem hiding this comment.
Do we want to do this - or should we tell them to type 'EXIT' which tells the SDK to run the Shutdown command, and therefore shuts down the GameServer?
671e057 to
b8a29b5
Compare
|
Everything should be resolved. |
markmandel
left a comment
There was a problem hiding this comment.
All just super minor stuff.
But I tested out all the steps, and everything works!
README.md
Outdated
| - [Create a Game Server](./docs/create_gameserver.md) | ||
|
|
||
| ### Guides | ||
| - [Game Server Specification](./docs/gameserver_spec.md) |
There was a problem hiding this comment.
Should the spec be under "Reference" ? WDYT?
docs/create_gameserver.md
Outdated
|
|
||
| ## Objectives | ||
|
|
||
| - Create a GameServer in kubernetes using Agones custom ressources. |
docs/create_gameserver.md
Outdated
| EXIT | ||
| ``` | ||
|
|
||
| You can finally type `EXIT` which tells the SDK to run the Shutdown command, and therefore shuts down the `GameServer`. |
There was a problem hiding this comment.
Link "Shutdown command" to https://github.com/googleprivate/agones/tree/master/sdks#shutdown
There was a problem hiding this comment.
Should we also make a note something like:
"Which you can see if you run kubectl describe gameserver again - either the GameServer will be gone completely, or it will be in Shutdown state, on the way to being deleted"
Or something to that effect?
docs/create_gameserver.md
Outdated
| watch kubectl describe gameserver | ||
| ``` | ||
|
|
||
| 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. |
There was a problem hiding this comment.
Minor thought: Should this section be after the example? Not sure.
There was a problem hiding this comment.
Yes read again and I give some space.
|
|
||
| 1. A Kubernetes cluster with the UDP port range 7000-8000 open on each node. | ||
| 2. Agones controller installed in the targeted cluster | ||
| 3. kubectl properly configured |
| Let's wait for the GameServer state to become `Ready`: | ||
|
|
||
| ``` | ||
| watch kubectl describe gameserver |
docs/create_gameserver.md
Outdated
| You can now communicate with the Game Server : | ||
|
|
||
| ``` | ||
| nc -u 10.130.65.208 7936 |
There was a problem hiding this comment.
Should this be nc -u {IP} {PORT}
???
docs/gameserver_spec.md
Outdated
|
|
||
| Since Agones defines a new [Custom Ressources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/) we can define a new ressource using the kind `GameServer` with the custom group `stable.agones.dev` and API version `v1alpha1`. | ||
|
|
||
| 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 ressource. This is a very common pattern in the kubernetes ecosystem. |
There was a problem hiding this comment.
fixed everywhere.
docs/gameserver_spec.md
Outdated
| - `containerPort` the port that is being opened on the game server process, this is required field. | ||
| - `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](./health_checking.md). | ||
| - `template` the [pod spec template](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#pod-v1-core) to run you GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more No newline at end of file |
There was a problem hiding this comment.
for more .... "information" ? 😄
b8a29b5 to
f9b7a40
Compare
|
Voila |
This should resolves #45