googleforgames / agones

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

No validation when helm parameter `agones.image.sdk.cpuRequest` set less than `cpuLimit` #1419

Closed aLekSer closed 4 years ago

aLekSer commented 4 years ago

Similar to what we have in #1298 if we set cpuRequest < cpuLimits then no pods for GameServers could be created.

What happened: Helm allows to set agones.image.sdk parameters which does not correlate to each other.

What you expected to happen: There should be an error on helm install step.

How to reproduce it (as minimally and precisely as possible):

$ helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-7791336 --set agones.image.sdk.cpuRequest=64Mi --set $ agones.image.sdk.cpuLimit=62Mi
$ kubectl apply -f ./examples/simple-udp/fleet.yaml
$ kubectl get gs
NAME                     STATE            ADDRESS   PORT   NODE   AGE
simple-udp-2b5l4-48lvp   Creating                                 0s
simple-udp-2b5l4-6pwzs   PortAllocation                           0s
simple-udp-2b5l4-ltjll   Shutdown                                 0s
simple-udp-2b5l4-trdtz   Error                                    0s
simple-udp-2b5l4-wxp2w   Shutdown                                 0s 
$ kubectl describe gss
...

  Normal  SuccessfulCreate  36s (x5 over 36s)  gameserverset-controller  (combined from similar events): Created gameserver: simple-udp-2b5l4-ccpkx                                                      
  Normal  SuccessfulDelete  36s                gameserverset-controller  Deleted gameserver in state Unhealthy: simple-udp-2b5l4-hcmfw                                                                   
  Normal  SuccessfulDelete  36s                gameserverset-controller  Deleted gameserver in state Unhealthy: simple-udp-2b5l4-pqj7r                                                                   
  Normal  SuccessfulDelete  36s (x2 over 36s)  gameserverset-controller  (combined from similar events): Deleted gameserver in state Unhealthy: simple-udp-2b5l4-rj4hs    

Anything else we need to know?: Similar issue with memoryRequest and memoryLimit parameters .

Environment:

aLekSer commented 4 years ago

More than that currently we are able to pass negative values to these helms parameters, while Kubernetes Pod does not pass validation. And one more issue is when we set 1m as Memory Limit or Request: https://github.com/kubernetes/kubernetes/issues/79950