Minecraft dedicated game server cluster hosting solution using GKE and Agones
gcloud dns managed-zones create agones-minecraft \ # Any name
--description="agones-mc-dns-controller managed DNS zone" \
--dns-name=<DOMAIN> \ # Domain that you own
--visibility=publicPoint domain to Google nameservers
gcloud dns managed-zones describe agones-minecraftgcloud container clusters create minecraft --cluster-version=1.18 \
--tags=mc \
--scopes=gke-default,"https://www.googleapis.com/auth/ndev.clouddns.readwrite" \ # GKE scope needed for Cloud DNS
--node-labels=agones-mc/domain=<DOMAIN_NAME> \ # Replace with the domain for the zone that the controller will manage
--num-nodes=2 \
--no-enable-autoupgrade \
--machine-type=n2-standard-4gcloud config set container/cluster minecraft
gcloud container clusters get-credentials minecraftgcloud compute firewall-rules create mc-server-firewall \
--allow tcp:7000-8000 \
--target-tags mc \
--description "Firewall rule to allow mc server tcp traffic"kubectl create namespace agones-system
kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.14.0/install/yaml/install.yamlor
helm repo add agones https://agones.dev/chart/stable
helm repo update
helm install agones --namespace agones-system --create-namespace agones/agoneskubectl get pods -n agones-system sed 's/<MANAGED_ZONE>/agones-minecraft/' <(curl https://raw.githubusercontent.com/saulmaldonado/agones-minecraft/main/k8s/agones-mc-dns-controller.yaml) | kubectl apply -f - # agones-minecraft matches the name of zone created earliersed 's/<DOMAIN>/example.com/' k8s/mc-server-fleet.yml | kubectl apply -f - # replace 'example.com' with the domain you will be usingkubectl create -f k8s/allocation.ymlkubectl get gs -o jsonpath='{.items[?(@.status.state=="Allocated")].metadata.annotations.agones-mc/externalDNS}'sed 's/<DOMAIN>/example.com/' k8s/mc-bedrock-fleet.yml | kubectl apply -f - # replace 'example.com' with the domain you will be usingkubectl create -f k8s/bedrock-allocation.ymlkubectl get gs -o jsonpath='{.items[?(@.status.state=="Allocated")].metadata.annotations.agones-mc/externalDNS}'