googleforgames / agones

Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes
https://agones.dev
Apache License 2.0
6.08k stars 808 forks source link

Extend Webhook autoscaler to send fleet metadata with the request #3951

Open swermin opened 2 months ago

swermin commented 2 months ago

Is your feature request related to a problem? Please describe. We are running our fleets throughout different clusters and independently of one and other and use the webhook autoscaler to make sure that we have necessary sizes on all the fleets. With this solution we are allocating game servers based on labels and not on fleet names, this means that on the webhook autoscaler endpoint we have no idea to determine the size since the request does not contain any metadata at all regarding the fleet in question.

Describe the solution you'd like We want to extend the FleetAutoscaleRequest to include the fleet metadata when reporting to the service(s).

Describe alternatives you've considered We made changes to the URL used for the webhook but that means that we have to update the URL every time we add new label and/or annotations

markmandel commented 2 months ago

Seems legit to me! I assume, name, annotations and labels?

swermin commented 2 months ago

That is correct. I was looking into the code and found that the easiest way to add these was to put the whole metadata into the request, but I do like the idea of making that payload smaller

markmandel commented 2 months ago

🤔 it would make the code easier to grab the entire metadata object and chuck it across.

If you're implementing it, I'll let you decide 😄

swermin commented 2 months ago

I've added a PR, let me know what you think 😄