A control panel for a Minecraft server running on K8s
This project consists of:
- frontend-control: A React frontend that polls the backend server
- backend: A Golang backend that talks to the Kubernetes API server and responds to HTTP requests from the frontend
Before deploying this project, you must modify the following files and configurations:
- Line 23: Update
NAMESPACEconstant to match your Kubernetes namespace (currently"mc") - Line 24: Update
DEPLOYMENT_NAMEconstant to match your Minecraft deployment name (currently"mc") - Line 25: Update
IMAGE_NAMEconstant to match your Minecraft server container image name (currently"minecraft-server") - Line 31: Update
authorizationTokento your own secure token (currently"Bearer b2xsaWUxMjMK")
- Line 15: Update
authorizationTokento match the backend token (currently"b2xsaWUxMjMK") - Line 17: Update
urlto your backend API endpoint (currently"https://mc-control-panel.homek8s.com/api/")
- Line 27: Update the ECR image URL to your own container registry:
- Replace
043039367084.dkr.ecr.us-east-1.amazonaws.comwith your AWS account ID and region - Or replace with your own container registry URL
- Replace
- Line 25: Ensure
ecr-registry-secretexists in your cluster, or removeimagePullSecretsif using public images - Line 7: Update namespace if not using
mcnamespace
- Line 26: Update the ECR image URL to your own container registry:
- Replace
043039367084.dkr.ecr.us-east-1.amazonaws.comwith your AWS account ID and region - Or replace with your own container registry URL
- Replace
- Line 24: Ensure
ecr-registry-secretexists in your cluster, or removeimagePullSecretsif using public images - Line 7: Update namespace if not using
mcnamespace
manifests/backend-ing.yaml(Line 14): Updatehostfield to your domain name (currentlymc-control-panel.homek8s.com)manifests/frontend-ing.yaml(Line 15): Updatehostfield to your domain name (currentlymc-control-panel.homek8s.com)
- Update all
namespace: mcreferences throughout all YAML files if you're using a different namespace
- Line 2: Set
cookie_secret- generate a secure random string (32 bytes base64 encoded) - Line 7: Set
client_secretfrom your OAuth provider (GitHub, Google, etc.) - Line 8: Set
client_idfrom your OAuth provider - Line 9: Update
redirect_urlto match your domain (currentlyhttps://mc-control-panel.homek8s.com/oauth2/callback) - Line 12: Update
github_orgto your GitHub organization (currentlyhomek8s-com), or changeproviderif using a different OAuth provider
- Line 6: Update
AWS_REGIONto your AWS region (currentlyus-east-1) - Line 8-9: Update repository names if using different ECR repository names
- Line 10-11: Verify paths are correct for your project structure
You will need to create the following secrets in your cluster:
-
ECR Registry Secret (if using private ECR images):
kubectl create secret docker-registry ecr-registry-secret \ --docker-server=<your-ecr-url> \ --docker-username=AWS \ --docker-password=$(aws ecr get-login-password --region <region>) \ -n <namespace>
-
OAuth2 Proxy Config Secret:
kubectl create secret generic frontend-proxy-config \ --from-file=oauth2-proxy.cfg=manifests/proxy/oauth2-proxy.cfg \ -n <namespace>
Or use the provided script:
manifests/proxy/create-proxy.sh(update namespace if needed)
manifests/role.yaml: Review and adjust permissions as needed for your security requirementsmanifests/sa.yaml: Ensure the service account name matches what's used in the backend deploymentmanifests/rolebinding.yaml: Verify namespace and service account references
- Build and push Docker images to your container registry
- Update all configuration files listed above
- Create required Kubernetes secrets
- Apply all manifests in the
manifests/directory - Ensure your ingress controller is properly configured
- Set up DNS records pointing to your ingress
- Remove static ips, replace with something better
- Templatize deployment with Helm
- Add RCON proxy container to talk to the minecraft server directly
- Add user list in UI