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

adding logrus to initcontainer #50

Merged
merged 1 commit into from
Nov 4, 2021
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
78 changes: 39 additions & 39 deletions docs/gameserverbuild.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# GameServerBuild definition
A GameServerBuild is equivalent to a Build region in MPS. GameServer containers that work in thundernetes should work in a similar way on PlayFab Multiplayer Servers service.
Here you can see the YAML that can be used to create a GameServerBuild in thundernetes. Fields are similar to the ones used on MPS.
```yaml
apiVersion: mps.playfab.com/v1alpha1
kind: GameServerBuild
metadata:
name: gameserverbuild-sample # required, name of the GameServerBuild
spec:
titleID: "1E03" # required, corresponds to the PlayFab TitleID your game server is using. Can be an arbitrary string
buildID: "85ffe8da-c82f-4035-86c5-9d2b5f42d6f5" # required, build ID of your game, must be GUID. Will be used for allocations
standingBy: 2 # required, number of standing by servers to create
max: 4 # reqired, max number of servers to create. Active+StandingBy servers will never be larger than max
crashesToMarkUnhealthy: 5 # optional, default is 5. It is the number of crashes needed to mark the GameServerBuild unhealthy. Once this happens, no other operation will take place
buildMetadata: # optional. Retrievable via GSDK, used to customize your game server
- key: "buildMetadataKey1"
value: "buildMetadataValue1"
- key: "buildMetadataKey1"
value: "buildMetadataValue1"
portsToExpose: # port names that you need to expose for your game server, read more below
- containerName: gameserver-sample # name of the container that you want its port exposed
portName: gameport # name of the port that you want to expose
podSpec:
containers:
- image: youGameServerImage:tag # image of your game server
name: gameserver-sample # name of the container. Must be the same as portsToExpose.containerName
ports:
- containerPort: 7777 # port that you want to expose
name: gameport # name of the port that you want to expose. Must be the same as portsToExpose.portName
```
The podSpec contains the definition for a [Kubernetes Pod](https://kubernetes.io/docs/concepts/workloads/pods/). As a result, you should include here whatever is needed for your game server (environment variables, storage, etc). Bear in mind though that not everything will work in MPS though.
## PortsToExpose
This is a list of containerName/portName tuples: These are the ports that you want to be exposed in the [Worker Node/VM](https://kubernetes.io/docs/concepts/architecture/nodes/) when the Pod is created. The way this works is that each Pod you create will have >=1 number of containers. There, each container will have its own *Ports* definition. If a port in this definition is included in the *portsToExpose* array, this port will be publicly exposed in the Node/VM. This is accomplished by the creation of a **hostPort** value for each of the container ports you want to expose. The reason we need this is that because i) you may want to use some ports on your Pod containers for other purposed than players connecting to it and ii) a portName must be unique within a container. Ports assigned are in the port range 10000-50000.
# GameServerBuild definition
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRLF vs LF again, sorry :(

Copy link
Collaborator

@khaines khaines Nov 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always LF :) CRLF takes up twice the space :)


A GameServerBuild is equivalent to a Build region in MPS. GameServer containers that work in thundernetes should work in a similar way on PlayFab Multiplayer Servers service.

Here you can see the YAML that can be used to create a GameServerBuild in thundernetes. Fields are similar to the ones used on MPS.

```yaml
apiVersion: mps.playfab.com/v1alpha1
kind: GameServerBuild
metadata:
name: gameserverbuild-sample # required, name of the GameServerBuild
spec:
titleID: "1E03" # required, corresponds to the PlayFab TitleID your game server is using. Can be an arbitrary string
buildID: "85ffe8da-c82f-4035-86c5-9d2b5f42d6f5" # required, build ID of your game, must be GUID. Will be used for allocations
standingBy: 2 # required, number of standing by servers to create
max: 4 # reqired, max number of servers to create. Active+StandingBy servers will never be larger than max
crashesToMarkUnhealthy: 5 # optional, default is 5. It is the number of crashes needed to mark the GameServerBuild unhealthy. Once this happens, no other operation will take place
buildMetadata: # optional. Retrievable via GSDK, used to customize your game server
- key: "buildMetadataKey1"
value: "buildMetadataValue1"
- key: "buildMetadataKey1"
value: "buildMetadataValue1"
portsToExpose: # port names that you need to expose for your game server, read more below
- containerName: gameserver-sample # name of the container that you want its port exposed
portName: gameport # name of the port that you want to expose
podSpec:
containers:
- image: youGameServerImage:tag # image of your game server
name: gameserver-sample # name of the container. Must be the same as portsToExpose.containerName
ports:
- containerPort: 7777 # port that you want to expose
name: gameport # name of the port that you want to expose. Must be the same as portsToExpose.portName
```

The podSpec contains the definition for a [Kubernetes Pod](https://kubernetes.io/docs/concepts/workloads/pods/). As a result, you should include here whatever is needed for your game server (environment variables, storage, etc). Bear in mind though that not everything will work in MPS though.

## PortsToExpose

This is a list of containerName/portName tuples: These are the ports that you want to be exposed in the [Worker Node/VM](https://kubernetes.io/docs/concepts/architecture/nodes/) when the Pod is created. The way this works is that each Pod you create will have >=1 number of containers. There, each container will have its own *Ports* definition. If a port in this definition is included in the *portsToExpose* array, this port will be publicly exposed in the Node/VM. This is accomplished by the creation of a **hostPort** value for each of the container ports you want to expose. The reason we need this is that because i) you may want to use some ports on your Pod containers for other purposed than players connecting to it and ii) a portName must be unique within a container. Ports assigned are in the port range 10000-50000.
5 changes: 4 additions & 1 deletion initcontainer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module github.com/playfab/thundernetes/initcontainer

go 1.16

require github.com/pkg/errors v0.9.1 // indirect
require (
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
)
7 changes: 7 additions & 0 deletions initcontainer/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Loading