googleforgames / agones

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

Allow for tolerations or nodeAffinity for game servers #1747

Closed jicowan closed 4 years ago

jicowan commented 4 years ago

Is your feature request related to a problem? Please describe. I do not see a way to run game servers on specific instance types. Can I include nodeAffinity or a toleration in the template section? I could try to do this with an admission controller like Gatekeeper that patches the pod's nodeAffinity or nodeSelector when deployed into a particular namespace, e.g. xbox, but I'd rather not if I don't have to.

Describe the solution you'd like I would like to be able to schedule game servers onto specific instances or node pools/groups using nodeAffinity or tolerations. I didn't see a way to do this in the game-server spec.

markmandel commented 4 years ago

The GameServer has full access to the entire PodTemplateSpec: https://agones.dev/site/docs/reference/agones_crd_api_reference/#agones.dev/v1.GameServerSpec

So you can set any value there that you want on your Pod, including node selectors, affinity, etc, or use taints etc.

I assume that will solve your problem?

jicowan commented 4 years ago

Sure will! Thanks @markmandel.