From fa8a1b96feacaa7a0d0ccd5d1578783113fedf20 Mon Sep 17 00:00:00 2001 From: John Fontalvo Date: Wed, 28 Sep 2022 01:08:01 -0500 Subject: [PATCH 1/5] add minecraft sample yaml --- samples/minecraft/sample.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 samples/minecraft/sample.yaml diff --git a/samples/minecraft/sample.yaml b/samples/minecraft/sample.yaml new file mode 100644 index 00000000..22a40c66 --- /dev/null +++ b/samples/minecraft/sample.yaml @@ -0,0 +1,24 @@ +apiVersion: mps.playfab.com/v1alpha1 +kind: GameServerBuild +metadata: + name: gameserverbuild-sample-minecraft +spec: + titleID: "1E03" # required + buildID: "85ffe8da-c82f-4035-86c5-9d2b5f42d6f8" # must be a GUID + standingBy: 2 # required + max: 4 # required + crashesToMarkUnhealthy: 5 # optional, default is 5. It is the number of crashes needed to mark the build unhealthy + portsToExpose: + - 25565 + template: + spec: + containers: + - image: rnjohn/minecraft-server-test + name: thundernetes-sample-minecraft + ports: + - containerPort: 25565 # your game server port + protocol: TCP # your game server port protocol + name: gameport # required field + env: + - name: EULA + value: "true" \ No newline at end of file From a2d0364851a46689e08d59de70d7790aed281ec6 Mon Sep 17 00:00:00 2001 From: John Fontalvo Date: Wed, 28 Sep 2022 01:56:07 -0500 Subject: [PATCH 2/5] add minecraft server sample docs --- docs/quickstart/sample-minecraft.md | 19 +++++++++++++++++++ samples/minecraft/README.md | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 docs/quickstart/sample-minecraft.md create mode 100644 samples/minecraft/README.md diff --git a/docs/quickstart/sample-minecraft.md b/docs/quickstart/sample-minecraft.md new file mode 100644 index 00000000..4d50a93e --- /dev/null +++ b/docs/quickstart/sample-minecraft.md @@ -0,0 +1,19 @@ +--- +layout: default +title: Minecraft sample +parent: Samples +grand_parent: Quickstart +nav_order: 2 +--- + +# Minecraft sample + +This sample, located [here](https://github.com/PlayFab/thundernetes/tree/main/samples/minecraft), is based on the popular sandbox game [Minecraft](https://www.minecraft.net/). You can install it using this script: + +{% include code-block-start.md %} +kubectl apply -f https://raw.githubusercontent.com/PlayFab/thundernetes/main/samples/minecraft/sample.yaml +{% include code-block-end.md %} + +To connect to an active server, you need to own a Minecraft Bedrock Edition copy (paid) from [here](https://www.minecraft.net/en-us/get-minecraft). + +To allocate a game server (convert its state to active) and scale your GameServerBuild, you can check [here](allocation-scaling.md). \ No newline at end of file diff --git a/samples/minecraft/README.md b/samples/minecraft/README.md new file mode 100644 index 00000000..a29c19e2 --- /dev/null +++ b/samples/minecraft/README.md @@ -0,0 +1,5 @@ +# Minecraft GSDK sample for thundernetes + +Check the [quickstart](https://github.com/PlayFab/thundernetes/blob/main/docs/quickstart.md) on how to run the Minecraft sample on thundernetes. + +This image is based on the itzg/minecraft-server docker image, but modified to initiate the server with the GSDK wrapper, since Minecraft is not an OSS. The modified dockerfile can be found [here](https://github.com/rnjohn/docker-minecraft-server-gsdk). \ No newline at end of file From 4a12188b34dbd1f2a0740f8af0422b26d3d14aa3 Mon Sep 17 00:00:00 2001 From: John Fontalvo Date: Wed, 28 Sep 2022 08:26:46 -0500 Subject: [PATCH 3/5] fix doc typo --- docs/quickstart/sample-minecraft.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart/sample-minecraft.md b/docs/quickstart/sample-minecraft.md index 4d50a93e..8547f812 100644 --- a/docs/quickstart/sample-minecraft.md +++ b/docs/quickstart/sample-minecraft.md @@ -14,6 +14,6 @@ This sample, located [here](https://github.com/PlayFab/thundernetes/tree/main/sa kubectl apply -f https://raw.githubusercontent.com/PlayFab/thundernetes/main/samples/minecraft/sample.yaml {% include code-block-end.md %} -To connect to an active server, you need to own a Minecraft Bedrock Edition copy (paid) from [here](https://www.minecraft.net/en-us/get-minecraft). +To connect to an active server, you need to own a Minecraft Java Edition copy (paid) from [here](https://www.minecraft.net/en-us/get-minecraft). To allocate a game server (convert its state to active) and scale your GameServerBuild, you can check [here](allocation-scaling.md). \ No newline at end of file From 1c8d2fa60a649001d109fc182a9c934dfc427aba Mon Sep 17 00:00:00 2001 From: John Fontalvo Date: Wed, 28 Sep 2022 11:50:47 -0500 Subject: [PATCH 4/5] add latest tag to image, add more info in the README --- docs/quickstart/sample-minecraft.md | 2 +- samples/minecraft/README.md | 4 +++- samples/minecraft/sample.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/quickstart/sample-minecraft.md b/docs/quickstart/sample-minecraft.md index 8547f812..f57d51df 100644 --- a/docs/quickstart/sample-minecraft.md +++ b/docs/quickstart/sample-minecraft.md @@ -3,7 +3,7 @@ layout: default title: Minecraft sample parent: Samples grand_parent: Quickstart -nav_order: 2 +nav_order: 3 --- # Minecraft sample diff --git a/samples/minecraft/README.md b/samples/minecraft/README.md index a29c19e2..36ba5aeb 100644 --- a/samples/minecraft/README.md +++ b/samples/minecraft/README.md @@ -2,4 +2,6 @@ Check the [quickstart](https://github.com/PlayFab/thundernetes/blob/main/docs/quickstart.md) on how to run the Minecraft sample on thundernetes. -This image is based on the itzg/minecraft-server docker image, but modified to initiate the server with the GSDK wrapper, since Minecraft is not an OSS. The modified dockerfile can be found [here](https://github.com/rnjohn/docker-minecraft-server-gsdk). \ No newline at end of file +This image is based on the itzg/minecraft-server [docker image](https://hub.docker.com/r/itzg/minecraft-server), which provides a Minecraft Server that will automatically download the latest stable version at startup. And it can also run/upgrade to any specific version or the latest snapshot. What I did was to modify the Dockerfile to retrieve the built GSDK wrapper from the GSDK wrapper docker image and copy it into the MC one, and then execute the wrapper along the script to start the server. The modified dockerfile can be found [here](https://github.com/rnjohn/docker-minecraft-server-gsdk). + +According to [itzg](https://github.com/itzg), the container will download the latest version of the "vanilla" Minecraft: Java Edition server provided by Mojang. The VERSION and the TYPE can be configured to create many variations of desired Minecraft server. In the itzg original [GitHub repo](https://github.com/itzg/docker-minecraft-server) you can find much more info in how does the container work and how to add more options on top of it, like plugins and mods. \ No newline at end of file diff --git a/samples/minecraft/sample.yaml b/samples/minecraft/sample.yaml index 22a40c66..4fec3ff2 100644 --- a/samples/minecraft/sample.yaml +++ b/samples/minecraft/sample.yaml @@ -13,7 +13,7 @@ spec: template: spec: containers: - - image: rnjohn/minecraft-server-test + - image: rnjohn/minecraft-server-test:latest name: thundernetes-sample-minecraft ports: - containerPort: 25565 # your game server port From 84f7cea318cff74ba2c507ed58719b097bcb863b Mon Sep 17 00:00:00 2001 From: John Fontalvo Date: Wed, 28 Sep 2022 11:55:27 -0500 Subject: [PATCH 5/5] add capital T to Thundernetes occurrences in README --- samples/minecraft/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/minecraft/README.md b/samples/minecraft/README.md index 36ba5aeb..6d463fe9 100644 --- a/samples/minecraft/README.md +++ b/samples/minecraft/README.md @@ -1,6 +1,6 @@ -# Minecraft GSDK sample for thundernetes +# Minecraft GSDK sample for Thundernetes -Check the [quickstart](https://github.com/PlayFab/thundernetes/blob/main/docs/quickstart.md) on how to run the Minecraft sample on thundernetes. +Check the [quickstart](https://github.com/PlayFab/thundernetes/blob/main/docs/quickstart.md) on how to run the Minecraft sample on Thundernetes. This image is based on the itzg/minecraft-server [docker image](https://hub.docker.com/r/itzg/minecraft-server), which provides a Minecraft Server that will automatically download the latest stable version at startup. And it can also run/upgrade to any specific version or the latest snapshot. What I did was to modify the Dockerfile to retrieve the built GSDK wrapper from the GSDK wrapper docker image and copy it into the MC one, and then execute the wrapper along the script to start the server. The modified dockerfile can be found [here](https://github.com/rnjohn/docker-minecraft-server-gsdk).