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 Allocation Endpoint GCP solution for multi-cluster allocation to Agones examples #2499

Merged
merged 4 commits into from
Mar 8, 2022

Conversation

pooneh-m
Copy link
Contributor

@pooneh-m pooneh-m commented Feb 28, 2022

What type of PR is this?
/kind documentation
/kind feature

What this PR does / Why we need it:

This is an example solution to leverage GCP for creating a proxy server that redirects game server allocation requests to the backend Agones clusters.

Using this solution:

  1. A Cloud Run instance is created and its URL is exposed as the allocation endpoint. Matchmaker sends allocation requests to this endpoint.
  2. Agones clusters can be added and removed using Cloud Run environment variables without any change to the caller of allocation endpoint (matchmaker)
  3. The solution leverages the GCP service account and removes the need for mTLS and client certificate management. It is compatible with Workload Identity.

Which issue(s) this PR fixes:

Closes # #2495

Special notes for your reviewer:

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: a708ab1d-e58b-4365-8277-4bd1f77078b6

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

@markmandel
Copy link
Member

Doesn't look like your fault, some 404's on aws autoscaling examples

site/docs/advanced/scheduling-and-autoscaling/index.html
  Non-OK status: 404 --- site/docs/advanced/scheduling-and-autoscaling/index.html --> https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/autoscaling.md
  Non-OK status: 404 --- site/docs/advanced/scheduling-and-autoscaling/index.html --> https://github.com/terraform-aws-modules/terraform-aws-eks/tree/master/examples/irsa

@roberthbailey roberthbailey changed the title Add Allocation Endpoint GCP solution for multi-cluster allocation to Agoens examples Add Allocation Endpoint GCP solution for multi-cluster allocation to Agones examples Feb 28, 2022
Copy link
Member

@roberthbailey roberthbailey left a comment

Choose a reason for hiding this comment

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

All of the files need to have the license header at the top.

examples/allocation-endpoint/README.md Outdated Show resolved Hide resolved
examples/allocation-endpoint/README.md Outdated Show resolved Hide resolved
examples/allocation-endpoint/README.md Outdated Show resolved Hide resolved
examples/allocation-endpoint/README.md Show resolved Hide resolved
examples/allocation-endpoint/README.md Outdated Show resolved Hide resolved
examples/allocation-endpoint/server/clusterselector.go Outdated Show resolved Hide resolved
examples/allocation-endpoint/server/main.go Show resolved Hide resolved
examples/allocation-endpoint/server/main.go Show resolved Hide resolved
examples/allocation-endpoint/server/main.go Show resolved Hide resolved
examples/allocation-endpoint/server/main.go Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 00c5374a-27ea-4489-8ea0-4471944fe0f6

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-6172a51

Copy link
Contributor

@ilkercelikyilmaz ilkercelikyilmaz left a comment

Choose a reason for hiding this comment

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

I left one comment. PTAL

examples/allocation-endpoint/client/main.go Show resolved Hide resolved
Copy link
Contributor Author

@pooneh-m pooneh-m left a comment

Choose a reason for hiding this comment

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

Thanks for the review.

examples/allocation-endpoint/README.md Show resolved Hide resolved
examples/allocation-endpoint/README.md Show resolved Hide resolved
examples/allocation-endpoint/README.md Show resolved Hide resolved
The `name` is a unique randomly selected name for the cluster.
The `endpoint` is the `agones-allocator` external IP.
The `namespace` is the game server namespace.
The `allocation_weight` is a value between 0 and 100, which sets the relative allocation rate a cluster receives compared to other clusters. By setting weight to zero, a cluster stops receiving allocation requests.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Thanks.

examples/allocation-endpoint/README.md Outdated Show resolved Hide resolved

```
docker build --tag gcr.io/[PROJECT-ID]/allocation-endpoint-proxy .
docker push gcr.io/[PROJECT-ID]/allocation-endpoint-proxy
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should do that for agones-images, but this is for the users and they can either use latest as the default or version it.

examples/allocation-endpoint/client/main.go Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 30b500f4-f980-4266-a811-84988b483ae7

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

@markmandel
Copy link
Member

@pooneh-m I have a feeling your main branch which this work is based on isn't up to date, since the two failures you've had have since been fixed. Can you double check your branch is up to date with upstream/main please?

@pooneh-m
Copy link
Contributor Author

pooneh-m commented Mar 2, 2022

@pooneh-m I have a feeling your main branch which this work is based on isn't up to date, since the two failures you've had have since been fixed. Can you double check your branch is up to date with upstream/main please?

My bad. It should be synced now.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 6cf0ad6e-5e71-4418-b30a-d792f464ba51

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-a98654d

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 08ae76a5-c1bc-455d-91e9-06557bceecb3

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-9f3929f

Copy link
Member

@roberthbailey roberthbailey left a comment

Choose a reason for hiding this comment

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

LGTM!

examples/allocation-endpoint/terraform/api_config.yaml.tpl Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 40e9487f-3346-4c5a-8cef-05f40bd1a02d

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-a14123f

Copy link
Member

@roberthbailey roberthbailey left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. LGTM!

@google-oss-prow google-oss-prow bot added the lgtm label Mar 6, 2022
@markmandel
Copy link
Member

markmandel commented Mar 7, 2022

Just making a note down here, so it doesn't get lost. If Robby has gone through everything, then I'm happy 👍🏻

The only thing I would like to see is if we are shipping a container as part of the examples, then we should have this be integrated with both make test-examples-on-gcr (examples.mk) for testing that the image version exists at release time, and also make release-example-image-markdown to add the example image to the release markdown as well (release.mk).

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 37803814-2fac-40c0-8aca-cd3cd7287003

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-eb24ad3

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 55c4a082-a5af-4ede-a443-629714534c80

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-9e3b548

Copy link
Member

@roberthbailey roberthbailey left a comment

Choose a reason for hiding this comment

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

Thanks for adding the makefile changes. I left a few comments on them.

build/includes/examples.mk Show resolved Hide resolved
examples/allocation-endpoint/Makefile Outdated Show resolved Hide resolved
examples/allocation-endpoint/README.md Show resolved Hide resolved
examples/allocation-endpoint/Makefile Show resolved Hide resolved
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cindy52, pooneh-m, roberthbailey

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:
  • OWNERS [pooneh-m,roberthbailey]

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

@google-oss-prow google-oss-prow bot added the lgtm label Mar 8, 2022
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cindy52, pooneh-m, roberthbailey

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:
  • OWNERS [pooneh-m,roberthbailey]

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

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: db1c1ab7-7445-425e-b4cf-b2009564ddfb

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-2dc7bae

@roberthbailey roberthbailey merged commit 3a91c0c into googleforgames:main Mar 8, 2022
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 01767487-214a-4991-b9fe-aae36c7e1f4a

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/googleforgames/agones.git pull/2499/head:pr_2499 && git checkout pr_2499
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.22.0-e379d12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants