How to use Google Kubernetes Engine for running dedicated Game server

How to use Google Kubernetes Engine for running dedicated Game server

13 January 2021

Google Kubernetes engine

As we know that Google Kubernetes engine contains various features which includes Enterprise-ready containerized solutions with prebuilt deployment template and also the featuring portability, simplified licensing, and consolidated billing. It also contains the feature to increase developer productivity. Apart from this it also provides Horizontal pod autoscaling based on CPU utilization or custom metrics.

These features can be used and would be very helpful when we set up a server especially for the applications where we can expect a lot of aberrations like a dedicated game server. So, we will set up a system through which we will use Google Kubernetes Engine with a dedicated game server with the help of a virtual machine.

Process

So first we will set up a virtual machine where we will Allow full access to all Cloud APIs for the VM and then we will SSH to that VM and will install kubectl and docker on the VM.

Google Kubernetes Engine for running dedicated Game server

Google Kubernetes Engine for running dedicated Game server

After that we will run the Docker build command to generate the container image and tag it and for the ease of it we will use the Google container registry to use with Google Kubernetes engine. And then we will push it as well.

Google Kubernetes Engine for running dedicated Game server

After this we will create and attach an appropriately-sized persistent disk. We need to make sure here that the persistent disk is separate from the boot disk, and it is configured in such a way that it remains undeleted when the virtual machine is removed. It is to be noted that we are using persistent disks here as Kubernetes persistent Volume functionality works best with persistent disks.

Google Kubernetes Engine for running dedicated Game server

As the disk is attached now, we will create the firewall rules first for the gaming cluster which will be set up after that.

Google Kubernetes Engine for running dedicated Game serverWe will create a three-node cluster here ( –numnodes 3 ) with four virtual CPU cores on each ( –machine-type=n1-standard-2 )

Google Kubernetes Engine for running dedicated Game server

The creation of a cluster ensures that the server is set up here for the game and we are running it on the Google Kubernetes Engine. After that we will set up a scaling manager in order to make sure that the scaling policy is set up. In the end we will test the whole arrangement by executing the “kubectl get pods” command and will get a similar output.

Google Kubernetes Engine for running dedicated Game server

This way we used the Google Kubernetes Engine for running dedicated game servers.

search

Blog Categories

Request a quote