You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Thundernetes is an experimental project and not recommended for production use. However, feel free to try it and let us know of any feedback! Thundernetes is a [code name](https://github.com/PlayFab/thundernetes/issues/177), project will soon have a new name!
9
+
Thundernetes makes it easy to run your game servers on Kubernetes.
10
10
11
-
## Description
11
+
> Thundernetes is a project still in development, feel free to try it and let us know of any [feedback](#feedback---community)!
12
12
13
-
Thundernetes is a project from the [Azure PlayFab Multiplayer Servers (MPS)](https://docs.microsoft.com/gaming/playfab/features/multiplayer/servers/) team that enables you to run Linux game servers on your Kubernetes cluster. Thundernetes can be useful in the following scenarios:
13
+
## ℹ️ Description
14
14
15
-
- host your game servers on a Kubernetes cluster, either on a public cloud provider or on-premises
16
-
- do manual allocations of game server sessions
17
-
- validate your game server integration with GSDK
18
-
- as part of your iterative development process, you can use thundernetes to test your game server code before pushing it to the MPS service
19
-
- as part of your CI/CD pipeline, you can publish the game server to a container registry and then have it deploy to a Kubernetes cluster where you can run your tests
15
+
Thundernetes is a project originating from the [Azure PlayFab Multiplayer Servers (MPS)](https://docs.microsoft.com/gaming/playfab/features/multiplayer/servers/) team and other teams in Azure/XBOX that enables you to run Linux game servers on your Kubernetes cluster. Thundernetes can be useful in the following scenarios:
20
16
21
-
## Usage
17
+
- host your game servers on a Kubernetes cluster, either on a public cloud provider or on-premise and allow your users to connect from everywhere
18
+
- pre-warm game servers so that they are ready to accept players within seconds, when the game is about to start
19
+
- as part of your iterative development process, you can use Thundernetes to test your game server code
22
20
23
-
Check [our website](https://playfab.github.io/thundernetes) for more information.
21
+
## 📚 Documentation
24
22
23
+
Check 🔥[our website](https://playfab.github.io/thundernetes)🔥 for more information.
25
24
26
-
## Feedback
25
+
## 💬❓Feedback - Community
27
26
28
-
As mentioned, thundernetes is in preview and a work in progress. If you find a bug or have a feature request, please file an issue [here](https://github.com/PlayFab/thundernetes/issues) and we will try to get back to you as soon as possible. You can also reach us directly on [Game Stack server on Discord](https://discord.gg/gamestack).
27
+
As mentioned, Thundernetes is in preview and a work in progress. If you find a bug or have a feature request, please file an issue [here](https://github.com/PlayFab/thundernetes/issues) and we will try to get back to you as soon as possible. You can also reach us directly on [Game Dev server on Discord](https://aka.ms/msftgamedevdiscord).
29
28
29
+
> Project will soon have a new name (https://github.com/PlayFab/thundernetes/issues/177)!
## Can I run a Unity or Unreal game server on thundernetes?
9
+
## Can I run a Unity or Unreal game server on Thundernetes?
10
10
11
-
You can run any game server that supports the [PlayFab GameServer SDK](https://github.com/PlayFab/gsdk). Check a Unity sample [here](https://github.com/PlayFab/thundernetes/tree/main/samples/unity/README.md). On [this](https://github.com/PlayFab/MpsSamples) repository you can find samples for all programming languages GSDK supports, like C#/Java/C++/Go/Unity/Unreal.
11
+
You can run any game server that supports the [PlayFab GameServer SDK](https://github.com/PlayFab/gsdk). Check a Unity sample [here](https://github.com/PlayFab/thundernetes/tree/main/samples/unity/README.md) and documentation for the Unreal plugin [here](https://github.com/PlayFab/gsdk/tree/main/UnrealPlugin). On [this](https://github.com/PlayFab/MpsSamples) repository you can find samples for all programming languages GSDK supports, like C#/Java/C++/Go/Unity/Unreal.
12
12
13
13
## How can I add custom Annotations and/or Labels to my GameServer Pods?
14
14
@@ -45,62 +45,13 @@ spec:
45
45
46
46
## Can I run my game server pods in a non-default namespace?
47
47
48
-
You don't need to do anything special to run your game server Pods in a namespace different than "default". Old versions of thundernetes (up to 0.1) made use of a sidecar to access the Kubernetes API Server, so you needed to create special RoleBinding and ServiceAccount in the non-default namespace. With the transition to DaemonSet NodeAgent in 0.2, this is no longer necessary.
49
-
50
-
## How do I schedule thundernetes Pods and GameServer Pods into different Nodes?
51
-
52
-
In production environments, you would like to have system and thundernetes Pods (Pods that are created on the kube-system and thundernetes-system namespaces) scheduled on a different set Nodes other than the GameServer Pods. One reason for this might be that you want special Node types for your GameServers. For example, you might want to have dedicated Nodes with special GPUs for your GameServers. Another reason might be that you don't want any interruption whatsoever to Pods that are critical for the cluster to run properly (system and thundernetes Pods). One approach to achieve this isolation on public cloud providers is by using multiple Node Pools. A Node Pool is essentially a group of Nodes that share the same configuration (CPU type, memory, etc) and can be scaled independently of the others. In production scenarios, it is recommended to use three Node Pools:
53
-
54
-
- one Node Pool for Kubernetes system resources (everything in kube-system namespace) and thundernetes system resources (everything in thundernetes-system namespace)
55
-
- one Node Pool for telemetry related Pods (Prometheus, Grafana, etc)
56
-
- one Node Pool to host your GameServer Pods
57
-
58
-
Let's discuss on how to create and use a Node Pool to host the GameServer Pods.
59
-
60
-
1. First, you would need to create a separate NodePool for the GameServer Pods. Check [here](https://docs.microsoft.com/azure/aks/use-multiple-node-pools) on how to do it on Azure Kubernetes Service. Create this on "user" mode so that "kube-system" Pods are not scheduled on this NodePool. Most importantly, when creating a NodePool, you can specify custom Labels for the Nodes. Let's assume that you apply the `agentpool=gameserver` Label.
61
-
1. Use the `nodeSelector` field on your GameServer Pod spec to request that the GameServer Pod is scheduled on Nodes that have the `agentpool=gameserver` Label. Take a look at this [sample YAML file](https://github.com/PlayFab/thundernetes/tree/main/samples/netcore/sample_second_node_pool.yaml) for an example.
62
-
1. When you create your GameServerBuild, the GameServer Pods will be scheduled on the NodePool you created.
63
-
1. Moreover, you should modify the `nodeSelector` field on the controller Pod spec to make sure it will be scheduled on the system Node Pool. On AKS, if the system Node Pool is called `nodepool1`, you should add this YAML snippet to the `thundernetes-controller-manager` Deployment on the [YAML install file](https://github.com/PlayFab/thundernetes/tree/main/installfiles/operator.yaml):
64
-
65
-
```YAML
66
-
nodeSelector:
67
-
agentpool: nodepool1
68
-
```
69
-
70
-
You should add the above YAML snippet to any workloads you don't want to be scheduled on the GameServer NodePool. Check [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) for additional information on assigning pods to Nodes and check [here](https://docs.microsoft.com/azure/aks/use-system-pools#system-and-user-node-pools) for more information on AKS system and user node pools.
71
-
72
-
### Schedule DaemonSet Pods on GameServer Nodes
73
-
74
-
> For more information on the NodeAgent process running in the DaemonSet, check the architecture document [here](architecture.md#gsdk-integration).
75
-
76
-
Now that we've shown how to run multiple Node Pools, let's discuss how to schedule DaemonSet Pods running NodeAgent process to run only on Nodes that run game server Pods. Since NodeAgent's only concern is to work with game server Pods on Node's it's been scheduled, it's unnecessary to run in on Nodes that run system resources and/or telemetry. Since we have already split the cluster into multiple Node Pools, we can use the `nodeSelector` field on the DaemonSet Pod spec to request that the DaemonSet Pod is scheduled on Nodes that have the `agentpool=gameserver` Label (or whatever Label you have added to your game server Node Pool). Take a look at the following example to see how you can modify your DaemonSet YAML for this purpose:
77
-
78
-
```YAML
79
-
apiVersion: apps/v1
80
-
kind: DaemonSet
81
-
metadata:
82
-
name: thundernetes-nodeagent
83
-
namespace: thundernetes-system
84
-
spec:
85
-
selector:
86
-
matchLabels:
87
-
name: nodeagent
88
-
template:
89
-
metadata:
90
-
labels:
91
-
name: nodeagent
92
-
spec:
93
-
nodeSelector: # add this line
94
-
agentpool: gameserver # add this line as well
95
-
containers:
96
-
...
97
-
```
48
+
Yes. You don't need to do anything special to run your game server Pods in a namespace different than "default".
98
49
99
50
## How do I make GameServer Pods start before DaemonSet Pods?
100
51
101
52
When a new Node is added to the Kubernetes cluster, a NodeAgent Pod (part of DaemonSet) will be created there. However, if there were pending GameServer Pods before the Node's addition to the cluster, they will also be scheduled on the new Node. Consequently, GameServer Pods might start at the same time as the NodeAgent Pod. GameServer Pods are heartbeating to the NodeAgent process so there is a chance that some heartbeats will be lost and, potentially, a state change from "" to "Initializing" will not be tracked (however, the GameServer Pod should have no trouble transitioning to StandingBy when the NodeAgent Pod is up and can process heartbeats).
102
53
103
-
There will be no impact from these lost heartbeats. However, you can tell Kubernetes to schedule NodeAgent Pods before the GameServer Pods by assigning Pod Priorities to the NodeAgent Pods. You can read more about Pod priority [here](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption) and specifically about the impact of Pod priority on scheduling order [here](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#effect-of-pod-priority-on-scheduling-order).
54
+
There will be no impact from these lost heartbeats. However, you can ask Kubernetes to schedule NodeAgent Pods before the GameServer Pods by assigning Pod Priorities to the NodeAgent Pods. You can read more about Pod priority [here](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption) and specifically about the impact of Pod priority on scheduling order [here](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#effect-of-pod-priority-on-scheduling-order).
104
55
105
56
## How can I add resource constraints to my GameServer Pods?
106
57
@@ -127,13 +78,10 @@ template:
127
78
128
79
For a full sample, you can check [here](https://github.com/PlayFab/thundernetes/tree/main/samples/netcore/sample-requestslimits.yaml).
129
80
130
-
## Not supported features (compared to MPS)
131
-
132
-
There are some features of MPS that are not yet supported on Thundernetes.
81
+
## How can I run custom code on my container to respond to a terminated event from Kubernetes?
133
82
134
-
1. Thundernetes, for the time being, supports only Linux game servers. Work to support Windows is tracked [here](https://github.com/PlayFab/thundernetes/issues/8), please leave a comment if that's important for you. If you want to host Windows game servers, you can always use [MPS](https://docs.microsoft.com/gaming/playfab/features/multiplayer/servers/).
135
-
1. On PlayFab MPS, you can upload a zip file that contains parts of your game server (referred to as assets). This is decompressed on the VM that your game server runs and is automatically mounted. You cannot do that on Thundernetes, however you can always mount a storage volume onto your Pod (e.g. check [here](https://kubernetes.io/docs/concepts/storage/volumes/#azuredisk) on how to mount an Azure Disk).
83
+
You can use the [PreStop container hook](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks). Effectively, this hook is executed when the container is terminated. You can use this hook to perform custom cleanup operations. Read [here](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination) for more information about Pod termination.
136
84
137
-
## Where does the name 'thundernetes' come from?
85
+
## Where does the name 'Thundernetes' come from?
138
86
139
87
It's a combination of the words 'thunderhead' and 'kubernetes'. 'Thunderhead' is the internal code name for the Azure PlayFab Multiplayer Servers service. Credits to [Andreas Pohl](https://github.com/Annonator) for the naming idea!
Thundernetes is a project from the Azure PlayFab Multiplayer Servers (MPS) team that enables you to run Linux game servers on your Kubernetes cluster. Thundernetes can be useful in the following scenarios:
15
+
## Prerequisite knowledge
16
16
17
-
- host your game servers on a Kubernetes cluster, either on a public cloud provider or on-premises
18
-
- do manual allocations of game server sessions
19
-
- validate your game server integration with GSDK
20
-
- as part of your iterative development process, you can use thundernetes to test your game server code before pushing it to the MPS service
21
-
- as part of your CI/CD pipeline, you can publish the game server to a container registry and then have it deploy to a Kubernetes cluster where you can run your tests
22
-
- For a game server to be able to run in thundernetes, it must use the PlayFab Game Server SDK (GSDK) either directly on the game server binary or indirectly, via a wrapper.
17
+
New to Kubernetes or containers? Check our [prerequisites](prerequisites.md) document that has resources that will fill the knowledge gaps when working with technologies within Thundernetes.
23
18
24
-
Thundernetes requires a Kubernetes cluster with Public IP per Node. We've tested it extensively on [Azure Kubernetes Service - AKS](https://docs.microsoft.com/azure/aks/intro-kubernetes) as well as in local clusters using [kind](https://kind.sigs.k8s.io/). You also need to have ports 10000-12000 open in your cluster, since these are the ports that Thundernetes by default will set up on your Kubernetes Nodes so they can receive game network traffic and forward to your game server Pod.
19
+
## Requirements
25
20
26
-
> This port range is configurable, check [here](howtos/configureportrange.md) for details.
27
-
> You can use a Kubernetes cluster without a Public IP. However, you would need to configure your own network architecture if you want to access your game servers. For example, if you use a cloud provider's Load Balancer, you would need to configure routes from Load Balancer's public endpoints to the internal ones on your Kubernetes cluster.
28
-
> You can try Azure Kubernetes Service for free [azure.com/free](https://azure.com/free).
21
+
Thundernetes requires:
29
22
30
-
## Prerequisites
23
+
- A Kubernetes cluster, either on-premise or on a public cloud provider. Ideally, the cluster should support having a Public IP per Node to allow external incoming connections
24
+
- A game server
25
+
- integrated with the open source [Game Server SDK](https://playfab.com/gsdk) (GSDK). GSDK has been battle-tested by multiple AAA titles for years on the [Azure PlayFab Multiplayer Servers service](https://docs.microsoft.com/gaming/playfab/features/multiplayer/servers/) and supports multiple popular programming languages and game engines like Unity, Unreal, C#, C++, Java, Go.
26
+
- built as a Linux container image. This image should be deployed to a container registry that your Kubernetes cluster can access.
31
27
32
-
Check our [prerequisites](docs/prerequisites.md) document that has resources that will fill the knowledge gaps when working with technologies within thundernetes.
28
+
> **_NOTE_**: You can avoid having to integrate with GSDK by using the [wrapper sample](usingwrapper.md). This sample is great if you want to experiment with Thundernetes, however proper GSDK integration is highly recommended.
33
29
34
30
## Quickstart
35
31
36
-
Check the [quickstart](docs/quickstart.md) document on how to install thundernetes on your cluster and run the sample game server.
32
+
Check the [quickstart](quickstart.md) document on how to install Thundernetes on your cluster and run a sample game server to verify that Thundernetes is working properly.
37
33
38
-
### Installing on Azure Kubernetes Service
34
+
Click on the following image to see how easy it is to install and use Thundernetes:
39
35
40
-
Click on the following image for a quick preview of the quickstart:
If you are interested in contributing to thundernetes, please read our [Contributing Guide](contributing.md) and open a PR. We'd be more than happy to help you out!
51
+
If you are interested in contributing to Thundernetes, please read our [Contributing Guide](contributing.md) and open a PR. We'd be more than happy to help you out!
0 commit comments