Skip to content

Commit

Permalink
Update GameServer state diagram with Reserved
Browse files Browse the repository at this point in the history
Update dot and generated PNG with the Reserved state, and resultant
flow from there.

Tried to keep it as simple as possible, while still representing
potential state changes.

Should be final work on #660 except for missing SDK functions.
  • Loading branch information
markmandel committed Jul 23, 2019
1 parent fae0ef7 commit 908acf8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
9 changes: 5 additions & 4 deletions site/content/en/docs/Reference/gameserver.md
Expand Up @@ -38,7 +38,7 @@ spec:
imagePullPolicy: Always
```
{{% /feature %}}
{{% feature publishversion="0.12.0" %}}
{{% feature publishVersion="0.12.0" %}}
```yaml
apiVersion: "agones.dev/v1"
kind: GameServer
Expand Down Expand Up @@ -71,7 +71,7 @@ spec:
{{% feature expiryVersion="0.12.0" %}}
Since Agones defines a new [Custom Resources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/) we can define a new resource using the kind `GameServer` with the custom group `stable.agones.dev` and API version `v1alpha1`.
{{% /feature %}}
{{% feature publishversion="0.12.0" %}}
{{% feature publishVersion="0.12.0" %}}
Since Agones defines a new [Custom Resources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/) we can define a new resource using the kind `GameServer` with the custom group `agones.dev` and API version `v1`.
{{% /feature %}}

Expand All @@ -95,7 +95,7 @@ The `spec` field is the actual GameServer specification and it is composed as fo
{{% feature expiryVersion="0.12.0" %}}
- `template` the [pod spec template](https://v1-11.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podtemplatespec-v1-core) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information.
{{% /feature %}}
{{% feature publishversion="0.12.0" %}}
{{% feature publishVersion="0.12.0" %}}
- `template` the [pod spec template](https://v1-12.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.12/#podtemplatespec-v1-core) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information.
{{% /feature %}}

Expand All @@ -109,4 +109,5 @@ Game Servers are created through Kubernetes API (either directly or through a [F
- Allocation controller, which marks game servers as `Allocated` to handle a game session
- SDK, which manages health checking and shutdown of a game server session

![GameServer State Diagram](../../../diagrams/gameserver-states.dot.png)
{{% feature expiryVersion="0.12.0" %}}![GameServer State Diagram](../../../diagrams/gameserver-states.dot-0.11.png){{% /feature %}}
{{% feature publishVersion="0.12.0" %}}![GameServer State Diagram](../../../diagrams/gameserver-states.dot.png){{% /feature %}}
11 changes: 10 additions & 1 deletion site/static/diagrams/gameserver-states.dot
Expand Up @@ -11,6 +11,7 @@ digraph {
Scheduled
RequestReady
Ready
Reserved
Allocated
Shutdown
Unhealthy
Expand All @@ -23,21 +24,29 @@ digraph {
PortAllocation -> Creating [ label="allocated unused port", color="blue" ]
Creating -> Starting [ label="created pod", color="blue" ]
Starting -> Scheduled [ label="we have a pod, fetch its address", color="blue" ]
Scheduled -> Reserved [ label="SDK.reserved(seconds)", color="purple" ]
Scheduled -> RequestReady [ label="SDK.ready()", color="purple" ]
RequestReady -> Ready [ label="ready to be allocated", color="blue" ]
Reserved -> Ready [label="if seconds > 0 \land failed to call \lSDK.allocate() " color="purple"]

Ready -> Allocated [ label="allocated for use", color="orange" ]
Ready -> Allocated [ label="SDK.allocate() ", color="purple" ]
Reserved -> Allocated [color="purple"]

Creating -> Error [ label="failed to create pod", color="blue" ]

Scheduled -> Shutdown [ label="SDK.shutdown()", color="purple" ]
RequestReady -> Shutdown [ color="purple" ]
Ready -> Shutdown [ color="purple" ]
Allocated -> Shutdown [ color="purple" ]
Reserved -> Shutdown [ color="purple" ]


Scheduled -> Unhealthy [ label="failed to call SDK.healthy()\nin a timely manner" ]
Scheduled -> Unhealthy [ label="failed to call SDK.healthy()\nin a timely manner" color="purple" ]
RequestReady -> Unhealthy [ color="purple" ]
Ready -> Unhealthy [ color="purple" ]
Allocated -> Unhealthy [ color="purple" ]
Reserved -> Unhealthy [ color="purple" ]

Unhealthy -> Deleted [ label="delete unhealthy game server", color="blue" ]
Shutdown -> Deleted [ label="delete finished game server", color="blue" ]
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/static/diagrams/gameserver-states.dot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 908acf8

Please sign in to comment.