-
Notifications
You must be signed in to change notification settings - Fork 816
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
Documentation quickstart and specification gameserver #124
Conversation
e157951
to
f444544
Compare
f444544
to
0064ea0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was willing to do it but then time run out. I'll remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can update this section once @dzlier-gcp has the new install guide, and redirect to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dzlier-gcp let me know when it's ready
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know, wasn't sure what to say
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
docs/integrating_sdk.md
Outdated
@@ -0,0 +1 @@ | |||
# Integrating the C++ SDK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
@@ -17,12 +17,9 @@ kind: GameServer | |||
metadata: | |||
name: "simple-udp" | |||
spec: | |||
portPolicy: "static" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good point let's do that, if users look at the file at least it is more explanatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
0064ea0
to
ce7c685
Compare
9cf5491
to
671e057
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep changing it.
Name: simple-udp | ||
Resources: | ||
Status: | ||
Address: 10.130.65.212 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to double check this isn't a real IP you care about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
netcat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're either on WSL or linux I guess you have that no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
docs/create_gameserver.md
Outdated
``` | ||
user@computer:~/$ gameserver "simple-udp" created | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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
.
docs/create_gameserver.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All just super minor stuff.
But I tested out all the steps, and everything works!
README.md
Outdated
|
||
### Guides | ||
- [Game Server Specification](./docs/gameserver_spec.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the spec be under "Reference" ? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved !
docs/create_gameserver.md
Outdated
|
||
## Objectives | ||
|
||
- Create a GameServer in kubernetes using Agones custom ressources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link "Shutdown command" to https://github.com/googleprivate/agones/tree/master/sdks#shutdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the text
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thought: Should this section be after the example? Not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Let's wait for the GameServer state to become `Ready`: | ||
|
||
``` | ||
watch kubectl describe gameserver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be nc -u {IP} {PORT}
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kubernetes (capitol K)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for more .... "information" ? 😄
b8a29b5
to
f9b7a40
Compare
Voila |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This should resolves #45