Technical resources
Disaster Recovery of Minecraft Server from ROSA to ARO
Red Hat OpenShift cloud services help you automate the deployment and management of Red Hat OpenShift clusters so that you can build, deliver and maintain applications across every major public cloud environment—in less time. Red Hat OpenShift Service on AWS (ROSA) and Microsoft Azure Red Hat OpenShift (ARO ) are two services that Red Hat co-manages with AWS and Microsoft.
Application data protection on ARO/AWS is critical for businesses. Though Open Source Tools such as Velero provides kubernetes backup and restore functionality, Trilio provides enterprise-level features such as 24x7x365 support, scalable performance, hooks, operation visualization, and so on.
Our goal here is to demonstrate as a partner how you can execute seamless disaster recovery by backing up a Minecraft server in ROSA and restoring it in ARO. Minecraft is the best-selling video game in history, with over 238 million copies sold and nearly 140 million monthly active players as of 2021 and has been ported to several platforms." We thought it is the most renowned game in the world, and it is the perfect example of stateful application, while having some fun at the same time.
Prerequisites
- A ROSA Cluster that the original Minecraft Server lives
- A ARO Cluster that data to restore to
- An AWS S3 Bucket
- Install Certified TrilioVault OpenShift Operator on both clusters → How to install Trilio in OpenShift
- A Minecraft Client on your PC
Backing Up Application on ROSA
Create Trilio Backup Plan
The ansible playbook automates the following tasks to backup Minecraft server data to an AWS S3 bucket.
- Create a demo-Minecraft namespace
- Create a secret that holds the S3 bucket credentials
- Create a backup target that stores the backups
- Create a backup plan, which holds the instruction on what to backup to protect the Minecraft server data and metadata
[st@rtrek ansibledr]$ ansible-playbook backupsite.yaml |
Backup is ready:
Deploy Minecraft Server Application
The following commands deploy the Minecraft Server through a helm chart. The application provides a Load Balancer Service that maps to an AWS Elastic Load Balancer Service. Minecraft Client uses the Load Balancer IP to connect to the server.
oc project demo-minecraft oc adm policy add-scc-to-user anyuid -z default -n demo-minecraft helm repo add itzg https://itzg.github.io/minecraft-server-charts/ helm upgrade --install minecraft -f ./values.yaml --set minecraftServer.eula=true,minecraftServer.white-list=rodolfo itzg/minecraft Get the IP address of your Minecraft server by running these commands in the |
Create the backup
Now generate some stateful data and states by playing Minecraft !. Ansible Playbook backs up the data to the S3 target.
[st@rtrek ansibledr]$ ansible-playbook createbackup.yaml |
Restore Application to ARO
Ansible Playbook automated the process. This playbook creates an empty namespace, “demo-minecraft-restore”, a secret for the target, a target that holds the AWS S3 secret.
After a few minutes, everything will be restored in that namespace. ARO will create a LoadBalancer service in that the Minecraft client uses the external IP to connect to the server.
[[st@rtrek ansibledr]$ oc get all NAME READY STATUS RESTARTS AGE pod/aws-sa-demo4-target-browser-l7ztek-6b5575db7-g5sl6 1/1 Running 0 6m49s pod/minecfqnu-minecraft-6447d44cb5-v7qhh 0/1 Running 0 27s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/minecfqnu-minecraft LoadBalancer 172.30.184.128 20.102.37.28 25565:31879/TCP 28s service/tb-aws-sa-demo4-target-browser-l7ztek ClusterIP 172.30.154.178 <none> 80/TCP 6m50s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/aws-sa-demo4-target-browser-l7ztek 1/1 1 1 6m50s deployment.apps/minecfqnu-minecraft 0/1 1 0 28s NAME DESIRED CURRENT READY AGE replicaset.apps/aws-sa-demo4-target-browser-l7ztek-6b5575db7 1 1 1 6m50s replicaset.apps/minecfqnu-minecraft-6447d44cb5 1 1 0 28s NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD route.route.openshift.io/tb-aws-sa-demo4-target-browser-l7ztek-f2zzf trilio-system.apps.nvsgu1at.eastus.aroapp.io /aws-sa-demo4-target.demo-minecraft-restore tb-aws-sa-demo4-target-browser-l7ztek http edge/Redirect None |
Restore using Trilio UI
In restoring the Minecraft server to ARO, what we do is access the Trilio UI ( which is running inside ARO, and expose a route.
Don’t be surprised if the IPs or Minecraft screenshots look different, as I recorded different videos and restores for this blog post.
We see in the screenshot that the Trilio UI is a multi-cluster UI, so we took the backup in the Rosa instance, and now we are going to access the backup target from the ARO instance and start restoring from there. The source cluster could be down or inaccessible, and that would not prevent us from being able to restore it anyway:
We go to targets and select the aws-sa-demo4-target, where the backup was saved from Rosa
Then we click on launch browser:
We could select any backup on that backup target, but we choose the one we know the backup is:
And then the backup we want to restore, in this case, we only have one backup, but we could have one full and several incremental, and we could choose any of those:
Then we enter a name for the restore, and the namespace where we want to restore. If the namespace where we want to restore does not exist, we can create it here:
The restore will start at this point.
We can then go to ARO, and check that everything is being restored, like the Persistent Volume where the data is stored:
Here, we can see how the Helm release was just created:
And if we go to the service, we will find the LoadBalancer created in ARO:
Then we grab the LoadBalancer IP and use it in the Minecraft client. At this point we are in the same step as when we restored through Ansible. We only have to enter the IP, and connect to the Minecraft server:
And we can check that all our Minecraft inventory is where we left it! :
Summary
Managed OpenShift Clusters provide a seamless hybrid cloud experience on AWS and Microsoft Azure. Along with Certified TrilioVault Operator and Trilio vendor support, it provides rich features of disaster recovery and application mobility on multi-cloud.
Thank you for getting there! I hope it was interesting for you.
The GitHub repo where you can find the supporting files to test this demo is in the following URL:
https://github.com/trilio-demo/rosatoarodr
You can watch all this on Youtube!
Useful Links:
1. http://github.com/itzg/minecraft-server-charts
2. http://github.com/itzg/minecraft-server-charts/tree/master/charts/minecraft
3. http://github.com/gilesknap/k3s-minecraft
4. http://artifacthub.io/packages/helm/minecraft-server-charts/minecraft
5. Default values.yaml file http://github.com/itzg/minecraft-server-charts/blob/master/charts/minecraft/values.yaml
6. https://www.plural.sh/blog/how-to-run-a-minecraft-server-on-a-kubernetes-cluster/