-
Notifications
You must be signed in to change notification settings - Fork 813
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
feat: support multiple port ranges #3747
Conversation
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Failed 😱 Build Id: d2182235-1425-4ba6-8760-c65ed7c7354a To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
I dont really understand what caused the e2e tests to fail. If you could give me a hit where to look, that would be great. |
uuuh this test is killing me. |
Sorry - this a flake #3553 - it's been driving me up the wall. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I can't think of a better way! Added some questions and tweaks.
Some extra docs we will need:
- https://agones.dev/site/docs/reference/gameserver/
- https://github.com/googleforgames/agones/blob/main/examples/gameserver.yaml
I think that's about it. I may have some extra tweaks to the docs as I reread, but not seeing any issues. Nice work 👍🏻
// A set of port allocations for a node | ||
type portAllocation map[int32]bool | ||
|
||
//nolint:govet // ignore fieldalignment, singleton | ||
type portAllocator struct { | ||
type portRangeAllocator struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this refactor 👍🏻
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
1 similar comment
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Succeeded 👏 Build Id: e1643044-d05d-4165-8eb9-b7ca62640cd1 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:
|
Oh, one last request (and thank you for your patience): Please add e2e tests. It's a little tricky because for normal e2e tests we use the same install, but here you need to install it a different way and then test. You can add "custom" tests in this area: Lines 304 to 308 in c1320ee
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Failed 😱 Build Id: 92265a73-517a-41eb-bbae-71e87e9295d1 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
A hair brained idea. Given the config for this feature is really not great, and e2e tests seem to be tricky at best, what if the config for this feature came in the form of a CRD. The port ranges could be made immutable, and still checked for overlap via validation webhooks. It does, without a massive amount of thought, seems like it would solve a couple issues here. It does open a few new and exciting routes to failure, but I think some of those are somewhat unavoidable in any case. |
Given that the rest of the config for Agones is provided via Helm configuration parameters it seems weird to seperate this out. That being said, seems like a good time to start a https://helm.sh/docs/topics/charts/#schema-files ? |
@zmerlynn could we add some port ranges to And call it a day? Does it need to be a separate install? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've lost track through this, but a capturing some more thoughts @zmerlynn where chatting about and wanted to get your take.
- the current
minPort
andmaxPort
range should be calleddefault
- that way if people are naming ranges, they can usedefault
(which would also be the default, so it's backward compatible). - For validation for
GameServerSpec
on Autopilot, we could then say "if you pick a port range other thandefault
we will return an invalid configuration" (with appropriate documentation).
This means we don't have to validate that they are on autopilot at the helm install layer, and the end user gets a nice error message if they try and do something they shouldn't / can't on Autopilot that isn't as scary as a controller crash or similar.
WDYT?
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Failed 😱 Build Id: 03b0d831-7828-4ac0-ae74-235b97f29c91 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Failed 😱 Build Id: f582e71c-d62e-4d07-b5ad-f168747c17f9 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Just to make life easy - here's the validation block for agones/pkg/apis/agones/v1/gameserver.go Line 511 in 4bb6731
Which feeds into: agones/pkg/cloudproduct/gke/gke.go Line 134 in 4bb6731
For the Autopilot specific validation. (I don't think you implemented this yet) |
Build Succeeded 👏 Build Id: 5fa30dc4-feee-4186-bd4c-2cd3fefd55e4 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:
|
Is that not correct, or did I missing something extra I need to do? |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Succeeded 👏 Build Id: 9a979f38-4314-4f4a-8f00-c2c246921013 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:
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Succeeded 👏 Build Id: 2eaa7a79-d971-48d3-9bb1-9c91aee44ac8 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:
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Build Failed 😱 Build Id: ff547f82-31c0-4a55-860f-3e065a80898c To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Head branch was pushed to by a user without write access
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
@zmerlynn It turns out there was a test flake due to assuming the order of the input map. I removed the offending assertions, as the assertions above already prove they came from the correct port ranges. |
@nrwiersma Thanks for fixing it, LGTM! |
Build Succeeded 👏 Build Id: 026db8dc-cdba-4444-9d9d-5fbd2aed2362 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:
|
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [agones](https://agones.dev) ([source](https://github.com/googleforgames/agones)) | minor | `1.40.0` -> `1.41.0` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>googleforgames/agones (agones)</summary> ### [`v1.41.0`](https://github.com/googleforgames/agones/blob/HEAD/CHANGELOG.md#v1410-2024-06-04) [Compare Source](https://github.com/googleforgames/agones/compare/v1.40.0...v1.41.0) [Full Changelog](https://github.com/googleforgames/agones/compare/v1.40.0...v1.41.0) **Implemented enhancements:** - Configure Allocator Status Code by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3782](https://github.com/googleforgames/agones/pull/3782) - Graduate Counters and Lists to Beta by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3801](https://github.com/googleforgames/agones/pull/3801) - Passthrough autopilot - Adds an AutopilotPassthroughPort Feature Gate and new pod label by [@​vicentefb](https://github.com/vicentefb) in [https://github.com/googleforgames/agones/pull/3809](https://github.com/googleforgames/agones/pull/3809) - CountsAndLists: Move to Beta Protobuf by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3806](https://github.com/googleforgames/agones/pull/3806) - feat: support multiple port ranges by [@​nrwiersma](https://github.com/nrwiersma) in [https://github.com/googleforgames/agones/pull/3747](https://github.com/googleforgames/agones/pull/3747) - Changes `sdk-server` to Patch instead of Update by [@​igooch](https://github.com/igooch) in [https://github.com/googleforgames/agones/pull/3803](https://github.com/googleforgames/agones/pull/3803) - Generate grpc for nodejs from alpha to beta by [@​lacroixthomas](https://github.com/lacroixthomas) in [https://github.com/googleforgames/agones/pull/3825](https://github.com/googleforgames/agones/pull/3825) - Update CountsAndLists from Alpha to Beta by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3824](https://github.com/googleforgames/agones/pull/3824) - feat(gameserver): New DirectToGameServer PortPolicy allows direct traffic to a GameServer by [@​daniellee](https://github.com/daniellee) in [https://github.com/googleforgames/agones/pull/3807](https://github.com/googleforgames/agones/pull/3807) - Passthrough autopilot - Adds mutating webhook by [@​vicentefb](https://github.com/vicentefb) in [https://github.com/googleforgames/agones/pull/3833](https://github.com/googleforgames/agones/pull/3833) - Passthrough autopilot - added ports array case and updated unit tests by [@​vicentefb](https://github.com/vicentefb) in [https://github.com/googleforgames/agones/pull/3842](https://github.com/googleforgames/agones/pull/3842) - Nodejs counters and lists by [@​steven-supersolid](https://github.com/steven-supersolid) in [https://github.com/googleforgames/agones/pull/3726](https://github.com/googleforgames/agones/pull/3726) - Promote AutopilotPassthroughPort feature gate to Alpha by [@​vicentefb](https://github.com/vicentefb) in [https://github.com/googleforgames/agones/pull/3849](https://github.com/googleforgames/agones/pull/3849) **Fixed bugs:** - Helm Param Update: Default to agones.controller if agones.extensions is Missing by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3773](https://github.com/googleforgames/agones/pull/3773) - fix: rollout strategy issues by [@​nrwiersma](https://github.com/nrwiersma) in [https://github.com/googleforgames/agones/pull/3762](https://github.com/googleforgames/agones/pull/3762) - Set Minimum Buffer Size to 1 by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3749](https://github.com/googleforgames/agones/pull/3749) - Pin ltsc2019 to older SHA by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3829](https://github.com/googleforgames/agones/pull/3829) - TestGameServerAllocationDuringMultipleAllocationClients: Readdress flake by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3831](https://github.com/googleforgames/agones/pull/3831) - Refactor finalizer name to include valid domain name and path by [@​indexjoseph](https://github.com/indexjoseph) in [https://github.com/googleforgames/agones/pull/3840](https://github.com/googleforgames/agones/pull/3840) - agones-{extensions,allocator}: Be more defensive about draining by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3839](https://github.com/googleforgames/agones/pull/3839) - agones-{extensions,allocator}: Pause after cancelling context by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3843](https://github.com/googleforgames/agones/pull/3843) - Change the line to modify in Quickstart: Edit a Game Server by [@​peterzhongyi](https://github.com/peterzhongyi) in [https://github.com/googleforgames/agones/pull/3844](https://github.com/googleforgames/agones/pull/3844) **Other:** - Prep for Release v1.41.0 by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3800](https://github.com/googleforgames/agones/pull/3800) - Update site documentation to reflect firewall prefix and default to Autopilot cluster creation for Agones by [@​vicentefb](https://github.com/vicentefb) in [https://github.com/googleforgames/agones/pull/3769](https://github.com/googleforgames/agones/pull/3769) - Add a System Diagram and overview page by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3792](https://github.com/googleforgames/agones/pull/3792) - Update Side Menu: Preserve and Restore Scroll Position by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3805](https://github.com/googleforgames/agones/pull/3805) - fix: typo by [@​skmpf](https://github.com/skmpf) in [https://github.com/googleforgames/agones/pull/3808](https://github.com/googleforgames/agones/pull/3808) - Helm Config: Add httpUnallocatedStatusCode in Allocator Service by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3802](https://github.com/googleforgames/agones/pull/3802) - Update Docs: CountersAndLists to Beta by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3810](https://github.com/googleforgames/agones/pull/3810) - Disable Dev feature FeatureAutopilotPassthroughPort by [@​vicentefb](https://github.com/vicentefb) in [https://github.com/googleforgames/agones/pull/3815](https://github.com/googleforgames/agones/pull/3815) - Disable FeatureAutopilotPassthroughPort in features.go by [@​vicentefb](https://github.com/vicentefb) in [https://github.com/googleforgames/agones/pull/3816](https://github.com/googleforgames/agones/pull/3816) - SDK proto compatibility guarantees and deprecation policies documentation by [@​igooch](https://github.com/igooch) in [https://github.com/googleforgames/agones/pull/3774](https://github.com/googleforgames/agones/pull/3774) - Fix dangling "as of" by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3827](https://github.com/googleforgames/agones/pull/3827) - Steps to Promote SDK Features from Alpha to Beta by [@​Kalaiselvi84](https://github.com/Kalaiselvi84) in [https://github.com/googleforgames/agones/pull/3814](https://github.com/googleforgames/agones/pull/3814) - Adds comment for help troubleshooting issues with terraform tfstate by [@​igooch](https://github.com/igooch) in [https://github.com/googleforgames/agones/pull/3822](https://github.com/googleforgames/agones/pull/3822) - docs: improve counter and list example comments by [@​yonbh](https://github.com/yonbh) in [https://github.com/googleforgames/agones/pull/3818](https://github.com/googleforgames/agones/pull/3818) - Skip /tmp/ on yamllint by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3838](https://github.com/googleforgames/agones/pull/3838) - TestAllocatorAfterDeleteReplica: More logging by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3837](https://github.com/googleforgames/agones/pull/3837) - Instructions for upgrading golang version by [@​gongmax](https://github.com/gongmax) in [https://github.com/googleforgames/agones/pull/3819](https://github.com/googleforgames/agones/pull/3819) - Remove unused function FindGameServerContainer by [@​zmerlynn](https://github.com/zmerlynn) in [https://github.com/googleforgames/agones/pull/3841](https://github.com/googleforgames/agones/pull/3841) - Adds Unreal to the List of URL Links to Not Check by [@​igooch](https://github.com/igooch) in [https://github.com/googleforgames/agones/pull/3847](https://github.com/googleforgames/agones/pull/3847) - docs: clarify virtualization setup for Windows versions by [@​andresromerodev](https://github.com/andresromerodev) in [https://github.com/googleforgames/agones/pull/3850](https://github.com/googleforgames/agones/pull/3850) **New Contributors:** - [@​skmpf](https://github.com/skmpf) made their first contribution in [https://github.com/googleforgames/agones/pull/3808](https://github.com/googleforgames/agones/pull/3808) - [@​yonbh](https://github.com/yonbh) made their first contribution in [https://github.com/googleforgames/agones/pull/3818](https://github.com/googleforgames/agones/pull/3818) - [@​peterzhongyi](https://github.com/peterzhongyi) made their first contribution in [https://github.com/googleforgames/agones/pull/3844](https://github.com/googleforgames/agones/pull/3844) - [@​andresromerodev](https://github.com/andresromerodev) made their first contribution in [https://github.com/googleforgames/agones/pull/3850](https://github.com/googleforgames/agones/pull/3850) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9oZWxtIiwidHlwZS9taW5vciJdfQ==-->
What type of PR is this?
What this PR does / Why we need it:
This adds support for multiple named port ranges that can be configured in the GameServer port using the
range
property. This is behind a feature flagPortRanges
.Which issue(s) this PR fixes:
Closes #1911
Special notes for your reviewer:
I really dislike how the configuration has ended up, but I did not find a better way to do it. If you have a better idea, I would gladly take it.