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

Add sidecar memory resources setting #1402

Merged
merged 6 commits into from
Mar 16, 2020
Merged

Add sidecar memory resources setting #1402

merged 6 commits into from
Mar 16, 2020

Conversation

suecideTech
Copy link
Contributor

Add memory Requests/Limits for Gameserver resource estimation and Pod QoS class configuration.

About QoS

Details of Pod QoS is as below.
https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/

By setting the QoS to "guaranteed", if the node does not have enough resources, it is kill from pods other than "guaranteed".

Also, This is followed to be "Guaranteed" in the sample-udp example.
#487 (comment)

But, QoS is not assigned to "Guaranteed" unless CPU and Memory are the same in Limit and Request for each container.

When not set sidecar Requests/Limits.

$ kubectl describe po simple-udp-5xdrf
:
Containers:
  simple-udp:
    Image:          gcr.io/agones-images/udp-server:0.18
:
    Limits:
      cpu:     20m
      memory:  32Mi
    Requests:
      cpu:     20m
      memory:  32Mi
:
  agones-gameserver-sidecar:
    Image:         gcr.io/agones-images/agones-sdk:1.5.0-dcb266e
:
    Requests:
      cpu:     30m
:
QoS Class:       Burstable

When sidecar setting is "Guaranteed".

$ kubectl describe po simple-udp-k9lsh
:
Containers:
  simple-udp:
    Image:          gcr.io/agones-images/udp-server:0.18
:
    Limits:
      cpu:     20m
      memory:  32Mi
    Requests:
      cpu:     20m
      memory:  32Mi
:
  agones-gameserver-sidecar:
    Image:         gcr.io/agones-images/agones-sdk:1.5.0-dcb266e
:
    Limits:
      cpu:     100m
      memory:  100Mi
    Requests:
      cpu:     100m
      memory:  100Mi
:
QoS Class:       Guaranteed

Add Memory Requests/Limits for Gameserver resource estimation and Pod QoS settings
@suecideTech
Copy link
Contributor Author

/assign @cyriltovena

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: b70c58d8-ecdf-477b-8962-c267886a8c3f

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: a67c17c9-b4e9-43b3-ab29-c66776aaf818

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1402/head:pr_1402 && git checkout pr_1402
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-f554f7a

@roberthbailey
Copy link
Member

@suecideTech - can you also update the example yaml files so that the new api fields are documented for end users (who don't want to read the api spec / code)?

They live in two places: https://github.com/googleforgames/agones/blob/master/examples/gameserver.yaml (for developers looking at github) and https://github.com/googleforgames/agones/blob/master/site/content/en/docs/Reference/gameserver.md (for users looking at the website). For the latter, you will need to gate the changes based on the released agones version so that they don't appear immediately as described at https://agones.dev/site/docs/contribute/#within-a-page.

@suecideTech
Copy link
Contributor Author

@roberthbailey
There is no content describing this change in gameserver.yaml.
This PR change specifies the sidecar config included in the GameServer.
Therefore, there is no change in GameServer API.

Instead, this item is added to the configuration of helm Install.
3a1396a#diff-1eda647ccb61b12e7d45fc6883dce41c

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 233d536f-1578-4696-a88e-f6344ee338a8

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1402/head:pr_1402 && git checkout pr_1402
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-6981b14

@roberthbailey
Copy link
Member

Sorry, in my quick skim of the PR I thought you were adding api fields to set this on a per-sidecar basis, but upon a second look it's new flags to the controller that set it on a system-wide basis.

Copy link
Collaborator

@steven-supersolid steven-supersolid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only really comment on nodejs changes

@@ -1,6 +1,6 @@
{
"name": "@google-cloud/agones-sdk",
"version": "1.3.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this file should be part of the review. Please can it be reverted although we should also look at why it is out of date

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for checking!
It was a mistake...
revert and committed.

Revert files committed by mistake
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 89c2e058-1f14-4560-9d36-1d28e1e4e8ae

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1402/head:pr_1402 && git checkout pr_1402
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-4888c02

@@ -119,8 +119,10 @@ The following tables lists the configurable parameters of the Agones chart and t
| `agones.image.controller.pullPolicy` | Image pull policy for the controller | `IfNotPresent` |
| `agones.image.controller.pullSecret` | Image pull secret for the controller, allocator, sdk and ping image. Should be created both in `agones-system` and `default` namespaces | `` |
| `agones.image.sdk.name` | Image name for the sdk | `agones-sdk` |
| `agones.image.sdk.cpuRequest` | The [cpu request][constraints] for sdk server container | `30m` |
| `agones.image.sdk.cpuLimit` | The [cpu limit][constraints] for the sdk server container | `0` (none) |
| `agones.image.sdk.cpuRequest` | The [cpu request][cpu-constraints] for sdk server container | `30m` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only change I can see - this documentation should be in the "New Configuration Features:" section, since it's then hidden until the next release.

Other than that, this is a great new addition!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for checking!
I moved added config to "New configuration function".

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0f6e34d7-cfb6-4bde-a996-73d9215a9edf

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1402/head:pr_1402 && git checkout pr_1402
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-606f821

@aLekSer
Copy link
Collaborator

aLekSer commented Mar 16, 2020

Great to see these parameters.

What I see additionally to this PR is to validate these settings. Because Pod could not be created if cpuLimits < cpuRequests. I will add such validation for gameserver limits and requests.
Additional context could be found here:
#1298

@roberthbailey
Copy link
Member

I don't have any additional feedback on top of what @markmandel and @aLekSer have said so I'll defer to them for final review / approval.

Copy link
Collaborator

@aLekSer aLekSer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think additional validation of limits and request proportions could be done in a separate PR. I will take a look on it.
Waiting for resolving one comment above about the docs.

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aLekSer, markmandel, suecideTech

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@markmandel markmandel added area/operations Installation, updating, metrics etc kind/feature New features for Agones labels Mar 16, 2020
@markmandel markmandel added this to the 1.5.0 milestone Mar 16, 2020
@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 6c64f874-d2e5-4835-ae23-5f8ec87b3664

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1402/head:pr_1402 && git checkout pr_1402
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-a81195b

@markmandel markmandel merged commit 951c50b into googleforgames:master Mar 16, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
Add Memory Requests/Limits for Gameserver resource estimation and Pod QoS settings

Co-authored-by: Mark Mandel <markmandel@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/operations Installation, updating, metrics etc kind/feature New features for Agones size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants