This project deploys a Minecraft server on Amazon EKS (Elastic Kubernetes Service) using AWS CDK (Cloud Development Kit). It provides a scalable and maintainable way to run a Minecraft server in the cloud.
- AWS CLI configured with appropriate credentials
- Node.js and npm installed (for CDK CLI)
- Python 3.x installed
- AWS CDK CLI installed (
npm install -g aws-cdk
) - Docker installed (optional, for local testing)
- Clone the repository:
git clone https://github.com/jpvelasco/redstone-rigger.git
cd redstone-rigger
- Create and activate a Python virtual environment:
python3 -m venv .venv
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
- Install the required dependencies:
pip install -r requirements.txt
- Bootstrap your AWS environment for CDK (if you haven't already):
cdk bootstrap
- Synthesize the CloudFormation template to review changes:
cdk synth
- Deploy the stack:
cdk deploy
- After deployment, find your Minecraft server address:
- Go to the AWS EC2 console
- Navigate to "Load Balancers" in the left sidebar
- Find the load balancer created by this stack (named like "MinecraftEks-*")
- Use the DNS name from the "Description" tab as your Minecraft server address
- Launch your Minecraft Java Edition client
- Click "Multiplayer" > "Add Server"
- Enter a name for your server (e.g., "My EKS Server")
- For the server address, use:
Replace
<load-balancer-dns-name>:25565
<load-balancer-dns-name>
with the DNS name from step 4 of Deployment. - Click "Done" and connect to your server
This project creates the following AWS infrastructure:
- An Amazon EKS cluster running Kubernetes v1.24+
- A VPC with public and private subnets across multiple Availability Zones
- An EKS managed node group with t3.medium EC2 instances
- A Kubernetes deployment running the official Minecraft server image
- A Kubernetes LoadBalancer service to expose the Minecraft server
- Associated IAM roles and security groups
The Minecraft server can be customized through environment variables in the minecraft_server_manifest.yaml
file. Common settings include:
DIFFICULTY
: Set game difficulty (peaceful/easy/normal/hard)MODE
: Gameplay mode (survival/creative/adventure)MOTD
: Server description shown in the clientMAX_PLAYERS
: Maximum number of concurrent playersMEMORY
: Server memory allocation (default: "2G")ONLINE_MODE
: Enable/disable online mode verificationALLOW_NETHER
: Enable/disable Nether dimensionENABLE_COMMAND_BLOCK
: Enable/disable command blocks
Additional configuration options can be found in the official Minecraft server documentation.
Please be aware of the costs associated with running this infrastructure:
- EKS cluster management fee (~$0.10 per hour)
- EC2 instances in the node group (varies by instance type)
- Load Balancer charges
- Data transfer costs
To avoid ongoing charges, destroy the resources when not in use:
cdk destroy
-
Server Connection Issues:
- Verify the security group allows inbound traffic on port 25565
- Check if the EKS nodes are running:
kubectl get nodes
- View pod status:
kubectl get pods
- Check pod logs:
kubectl logs deployment/minecraft-server
-
Performance Issues:
- Monitor node resources:
kubectl top nodes
- Consider adjusting the server memory allocation
- Scale the node group if needed
- Monitor node resources:
-
Common kubectl Commands:
kubectl get all # View all resources
kubectl describe pod <pod-name> # Get detailed pod info
kubectl logs <pod-name> # View pod logs
kubectl exec -it <pod-name> -- sh # Access pod shell
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.