Skip to content

feature: clean up removed game server nodes - #485

Merged
lukepolo merged 1 commit into
mainfrom
feature/removed-node-cleanup
Oct 2, 2026
Merged

lukepolo merged 1 commit into
mainfrom
feature/removed-node-cleanup

Conversation

@lukepolo

@lukepolo lukepolo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Replaces #471.

Removing a game server node only deletes its game_server_nodes row, so its Node, Jobs and volumes stay in the cluster. A new job runs every 5 minutes and cleans them up:

  • Node: deleted once the node has no row and has been NotReady for 10 minutes. Control plane Nodes are never deleted.
  • Jobs, claims and volumes: deleted once the node id has neither a row nor a Node. This covers the update, gamedata validation and game-streamer Jobs pinned to it. Match server Jobs are left alone, and files on the node's disk are kept.

A host that is still running re-creates its row on its next ping, so it is never cleaned up. Since the job runs on a schedule, it also cleans up nodes that were removed before this change.

Needs 5stackgg/5stack-panel#638 so the api can delete Nodes. Until then it logs a warning and keeps the Node, and with it the node's volumes.

A host that registers again after the cleanup gets its row and volumes back on its next ping, including the CS:GO volume.

Testing

Unit tests, plus two runs against a real k3s in Docker: the first deleted the removed Node and the leftovers of a node with no row and no Node, and the second deleted the volumes of the Node removed in the first run.

@lukepolo
lukepolo merged commit 3ed8cb3 into main Oct 2, 2026
2 checks passed
@lukepolo
lukepolo deleted the feature/removed-node-cleanup branch October 2, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant