Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More Local Dev Server Support (#3252)
* More Local Dev Server Support This commit adds better support for integration between Dev Servers (called [Local Game Server](https://agones.dev/site/docs/guides/local-game-server/) in guides) and [Local Development](https://agones.dev/site/docs/guides/client-sdks/local/). Note that these changes do not affect prod flows, only developer flows when running manually with extra (new) command line arguments. * Updating SDK Server (`sdk-server/main.go`) for "out of cluster" mode. * Adding `--kubeconfig` cli flag to pass in a suitable k8s config file. * Makes use of `clientcmd.BuildConfigFromFlags()` to connect to the k8s cluster. * If the flag is not provided (as is the case for typical prod use), the `BuildConfigFromFlags()` call will internally fall back to the `InClusterConfig()`. * This is similar to the `--kubeconfig` cli arg for `cmd/controller/main.go`. * Adding `--no-graceful-termination` cli flag. * If set (default unset), the context `ctx` object will not be wrapped by the `NewSDKServerContext()` call. This means that exiting the program will not wait (block) for the `GameServer` state to update to `Shutdown`. * This flag to disable graceful shutdown is added as a convenient dev flow option, to quickly terminate and restart the SDK Server when testing locally. * Graceful termination was first added as an optional feature in #2205. * Fully rolled into stable (no longer optional feature) in #3231. * This flag does not affect normal (prod) flows (graceful termination still enabled by default). * Updating gameservers/controller.go to handle `RequestReady` to `Ready` transition. * `RequestReady` is set via SDK Server (from SDK calls). Need to transition to `Ready` to be allocatable. * Updated "Local Development" guide page (`docs/Guides/Client SDKs/local.md`) with information with running "out of cluster" mode. * Also added information about running from source code instead of prebuilt binaries -- which many devs would prefer. * Added links between "Local Development" guide page (`docs/Guides/Client SDKs/local.md`) and "Local Game Server" guide page (`docs/Guides/local-game-server.md`) about how they can be used together. * * Update documentation clarification location... -ation. * * Fixing formatting (had 1 too many spaces). * * Fixing ref relative paths. * * Removing quotes missed in previous cleanups. * * As per review feedback, updating `GAMESERVER_NAME` and `POD_NAMESPACE` to be passable via cli args instead of only as environment variables. * This should still function using environment variables due to calls to `viper.BindEnv()`. * Manually verified functionality when running locally with either cli args or environment variables. * Moving values to pass through `config` struct, just as other flags are passed. * Updating documentation to use cli args instead of environment variables. * * As per review feedback, changing from negative to positive logic for graceful termination flag. * Renaming `--no-graceful-termination` to `--graceful-termination`. * Setting default value to `true`. * Manually verified locally that graceful termination is on by default. * Updating indention. * Updating documentation to show renamed cli arg. * * Updating links to use `ref` instead of absolute site link. * * Switching "out of cluster" command example to use binary instead of running from source. * Done for consistency with other examples. * * Adding controller test for RequestReady -> Ready state progression. * * Adding `RequestReady` -> `Ready` state progressing in `TestDevelopmentGameServerLifecycle` e2e test. * * Fixing call to `StartInformers()` in test. * * Moving discussion of running from source code down to the bottom. * * Adding more cross-reference links for game server allocation. * * Moving "out of cluster" documentation into its own file. * Going into much more detail about background and steps to complete. * `publishDate` set to `2023-08-15T07:00:00Z` (midnight PST) to not publish doc immediately. * `2023-08-15` chosen to coincide with next release, per https://github.com/googleforgames/agones/blob/main/docs/governance/release_process.md#release-calendar. * Adding links to new page from `Local Game Server` and `Local Development` pages. * Links are wrapped by `publishVersion="1.34.0"` to not show immediately. `1.34.0` is the next release, per https://github.com/googleforgames/agones/blob/main/docs/governance/release_process.md#release-calendar. * * Switching OS/file description back to bulleted form similar to how it was before (but now as 1 set of bullets). * * Removing link to moved section (covered by "Next Steps" section). * * Cleaning up some wording. * * Adding comments about restarting locally run binaries. * * Proofread and update.
- Loading branch information