-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
creating/deleting gameservers in batch #141
Conversation
bb2d2a7
to
f181693
Compare
9a7eb7d
to
3b8c843
Compare
3b8c843
to
e629964
Compare
@@ -60,6 +58,11 @@ var gameServersUnderDeletion = sync.Map{} | |||
// concurrent since the reconcile loop can be called multiple times for different GameServerBuilds | |||
var crashesPerBuild = sync.Map{} | |||
|
|||
const ( | |||
maxNumberOfGameServersToAdd = 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe a todo here to remind us to make these overridable in the future? 20 is a great default, but their may be cases where someone will want to change this without changing the source code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll make an issue for that, good call!
Fixes #138 and #141
Due to the fact that GameServerBuild controller calls .Create(newGameServer) synchronously, the controller is blocked when there are multiple GameServers waiting to be created (or deleted). This PR fixes that by creating/deleting GameServers in batches of 20. Help was provided in this issue: kubernetes-sigs/controller-runtime#1782
Also moving resource requests/limits for the sample on a different sample file, so to assist with local development and scaling tests.