1.7 KiB
1.7 KiB
Game node operations
Game nodes run Docker workloads for Minecraft servers and connect to the control plane through the node-agent.
Capacity
Each node exposes:
maxServers,maxRamMb,platformRamMb- Host port pool:
portRangeStart–portRangeEnd(default25565–25664)
The scheduler places new servers on the least-loaded eligible node.
Enrollment
- Create a
GameNoderow in the control plane database. - Generate an enrollment token and distribute it securely to the node host.
- Start
node-agentwith matchingNODE_IDandNODE_TOKEN. - Confirm node status becomes
ONLINEin the admin API.
Port allocation
Host ports are unique per node (@@unique([nodeId, hostPort])). Do not manually assign ports outside the configured range.
Draining
Before maintenance:
- Set node status to
DRAININGvia admin API. - Wait for running servers to stop or migrate.
- Perform maintenance.
- Return node to
ONLINEor decommission.
Firewall
Allow:
- Outbound WebSocket to control plane API
- Inbound TCP on allocated Minecraft host port range
- Docker bridge traffic locally
Deny:
- Public access to Docker API
- Unrestricted inbound on management ports
Ansible
Bootstrap with:
ansible-playbook -i inventories/production deploy/ansible/game-node.yml
Copy the hgc-node-agent binary to /usr/local/bin/hgc-node-agent and provide TLS materials via NODE_TLS_CERT / NODE_TLS_KEY or CA enrollment.
Failure scenarios
| Scenario | Action |
|---|---|
| Node offline | Servers marked UNKNOWN; reschedule starts when node returns |
| Port exhaustion | Provisioning fails with NO_NODE_AVAILABLE; add node or expand port range |
| Disk full | Stop new provisions; prune unused images; expand volume |