googleforgames / agones

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

Terraform, Helm module install: Allow gameserver namespaces and port ranges to be specified in terraform #1692

Closed comerford closed 4 years ago

comerford commented 4 years ago

Is your feature request related to a problem? Please describe. The gameserver namespace and the port ranges used by the gameservers can be set in the values.yaml:

https://github.com/googleforgames/agones/blob/master/install/helm/agones/values.yaml#L150

However, unlike many other settings in that file, it is currently not possible to set these values as part of the terraform module and pass them in. This means that unless you stick with the default namespace, you will see failures to create pods when you attempt to create gameservers, and requires you to notice/find this part of the documentation:

https://agones.dev/site/docs/installation/install-agones/helm/#namespaces

Having these settings as values that can be passed in makes a lot of sense to me as I have missed this particular step twice now when installing.

Describe the solution you'd like The gamserver.minport/maxport and gameserver.namespaces values should be configurable similar to udp_expose, log_level and similar when using the helm module in terraform. Something like:

module "helm_agones" {
  source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/helm3/?ref=master"   

  udp_expose                     = "false"
  agones_version                = var.agones_version
  gameserver_minport        = 6800
  gameserver_maxport       = 8200
  gameserver_namespaces =  ["default", "xbox-gameservers", "pc-gameservers"]
...
}

Describe alternatives you've considered

These can be set after the fact using YAML and kubectl but it stops the config from being truly declaritive, requires extra documentation and manual steps and takes the control out of the terraform configuration and effectively outside SCM

Additional context I think I have most of what is needed in a branch that I can submit via a PR, will submit if there is no strong objection or obvious blocker to this that I have missed. Also, if there are changes needed beyond the helm modules that I have altered in the branch, I would love some pointers as to what those changes are. Branch: https://github.com/comerford/agones/tree/install_terraform_module_add_helm_settings

comerford commented 4 years ago

This is now part of the 1.8.0 release, closing