Skip to content
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

Merged
merged 5 commits into from
Jan 31, 2022
Merged

Conversation

dgkanatsios
Copy link
Collaborator

@dgkanatsios dgkanatsios commented Jan 21, 2022

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.

@dgkanatsios dgkanatsios added this to the 0.3.0 milestone Jan 25, 2022
@dgkanatsios dgkanatsios added the enhancement New feature or request label Jan 28, 2022
@dgkanatsios dgkanatsios marked this pull request as draft January 28, 2022 20:22
@dgkanatsios dgkanatsios force-pushed the batchcreategameservers branch 10 times, most recently from 9a7eb7d to 3b8c843 Compare January 28, 2022 22:32
@dgkanatsios dgkanatsios marked this pull request as ready for review January 28, 2022 23:51
@@ -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
Copy link
Collaborator

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 :)

Copy link
Collaborator Author

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!

@dgkanatsios dgkanatsios merged commit 430f8b0 into master Jan 31, 2022
@dgkanatsios dgkanatsios deleted the batchcreategameservers branch January 31, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GameServerBuild printer columns sometimes slow to display Desired StandingBy
2 participants