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

Create "Integration Patterns" section in docs #2215

Merged
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
3 changes: 2 additions & 1 deletion site/content/en/docs/FAQ/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ makes sense for your GameServer to return to the pool of potentially Allocatable
### What steps do I need to take to integrate my GameServer?

1. Integrate your game server binary with the [Agones SDK]({{< ref "/docs/Guides/Client SDKs/_index.md" >}}),
calling the appropriate [lifecycle event]({{< ref "/docs/Guides/gameserver-lifecycle.md" >}}) hooks.
calling the appropriate [lifecycle event]({{< ref "/docs/Guides/Client SDKs/_index.md#lifecycle-management" >}})
hooks.
1. Containerize your game server binary with [Docker](https://www.docker.com/)
1. Publish your Docker image in a [container registry/repository](https://docs.docker.com/docker-hub/repos/).
1. Create a [gameserver.yaml]({{< ref "/docs/Reference/gameserver.md" >}}) file for your container image.
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/Getting Started/create-fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ You have now deployed a new version of your game!
how the extra functionality can enable smoke testing, server information communication, and more.
- You can now create a fleet autoscaler to automatically resize your fleet based on the actual usage.
See [Create a Fleet Autoscaler]({{< relref "create-fleetautoscaler.md" >}}).
- Have a look at the [GameServer Creation, Allocation and Shutdown Lifecycle]({{< ref "/docs/Guides/gameserver-lifecycle.md" >}}) diagram,
to give you a good overview of how all the pieces fit together - from creating to integrating with a matchmaker.
- Have a look at the [GameServer Integration Patterns]({{< ref "/docs/Integration Patterns/_index.md" >}}),
to give you a set of examples on how all the pieces fit together with your matchmaker and other systems.
- Or if you want to try to use your own GameServer container make sure you have properly integrated the [Agones SDK]({{< ref "/docs/Guides/Client SDKs/_index.md" >}}).
- If you would like to learn how to programmatically allocate a Game Server from the fleet, see how to [Access Agones via the Kubernetes API]({{< relref "../Guides/access-api.md" >}}) or alternatively use the [Allocator Service]({{< relref "../Advanced/allocator-service.md" >}}), depending on your needs.
35 changes: 0 additions & 35 deletions site/content/en/docs/Guides/gameserver-lifecycle.md

This file was deleted.

14 changes: 14 additions & 0 deletions site/content/en/docs/Integration Patterns/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Common Integration Patterns"
linkTitle: "Integration Patterns"
weight: 8
date: 2021-07-27
description: >
Common patterns and integrations of external systems, such as matchmakers, with `GameServer` starting, allocating
and shutdown.
---

{{< alert title="Note" color="info" >}}
These examples will use the `GameServerAllocation` resource for convenience, but these same patterns can be applied
when using the [Allocation Service]({{% ref "/docs/Advanced/allocator-service.md" %}}) instead.
{{< /alert >}}
37 changes: 37 additions & 0 deletions site/content/en/docs/Integration Patterns/allocation-from-fleet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Matchmaker requests a GameServer from a Fleet"
linkTitle: "Allocation from a Fleet"
date: 2021-07-27
weight: 10
description: >
This is the preferred workflow for a GameServer, in which an external matchmaker requests an allocation from one or
more `Fleets` using a `GameServerAllocation`.
---


![Allocated Lifecycle Sequence Diagram](../../../diagrams/gameserver-lifecycle.puml.png)

## Sample `GameServerAllocation`

Since Agones will automatically add the label `agones.dev/fleet` to a `GameServer` of a given `Fleet`, we can use that
label selector to target a specific `Fleet` by name. In this instance, we are targeting the `Fleet` `xonotic`.

```yaml
apiVersion: "allocation.agones.dev/v1"
kind: GameServerAllocation
spec:
required:
matchLabels:
agones.dev/fleet: xonotic
```

## Next Steps:

- Read the various references, including the
[GameServer]({{< ref "/docs/Reference/gameserver.md" >}}) and [Fleet]({{< ref "/docs/Reference/fleet.md" >}})
reference materials.
- Review the specifics of [Health Checking]({{< ref "/docs/Guides/health-checking.md" >}}).
- See all the commands the [Client SDK]({{< ref "/docs/Guides/Client SDKs/_index.md" >}}) provides - we only show a
few here!
- If you aren't familiar with the term [Pod](https://kubernetes.io/docs/concepts/workloads/pods/pod/), this should
provide a reference.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: "Matchmaker requires game server process registration"
linkTitle: "Matchmaker registration"
date: 2021-07-27
weight: 20
description: >
A scenario in which a Matchmaker requires a game server process to register themselves with the matchmaker, and the
matchmaker decides which `GameServer` players are sent to.
---

In this scenario, the `GameServer` process will need to self Allocate when informed by the matchmaker that players
are being sent to them.

![Reserved Lifecycle Sequence Diagram](../../../diagrams/gameserver-reserved.puml.png)

{{< alert title="Warning" color="warning">}}
This does relinquish control over how `GameServers` are packed across the cluster to the external matchmaker. It is likely
it will not do as good a job at packing and scaling as Agones.
{{< /alert >}}

## Next Steps:

- Read the various references, including the
[GameServer]({{< ref "/docs/Reference/gameserver.md" >}}) and [Fleet]({{< ref "/docs/Reference/fleet.md" >}})
reference materials.
- Review the specifics of [Health Checking]({{< ref "/docs/Guides/health-checking.md" >}}).
- See all the commands the [Client SDK]({{< ref "/docs/Guides/Client SDKs/_index.md" >}}) provides - we only show a
few here!
- If you aren't familiar with the term [Pod](https://kubernetes.io/docs/concepts/workloads/pods/pod/), this should
provide a reference.