From c833e5dc262c797d7f17999d1fcc7ab15faa9778 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Fri, 12 Feb 2021 15:21:13 -0800 Subject: [PATCH] Remove simple-tcp and simple-udp (#1992) * Remove simple-tcp and simple-udp This covers: * Moving the windows build scripts from simple-udp to simple-game-server * Moving all the documentation to use simple-game-server (tested this by hand) * Updated all the examples to use simple-game-servers * Removal of both simple-udp and simple-tcp Closes #1890 * Review updates: * Only remove example links on release (had to add `‌` because of strange markdown formatting issues) * Update fleet_autoscaling.py fleet name --- build/Makefile | 2 +- build/includes/examples.mk | 2 - build/includes/release.mk | 2 - build/includes/sdk.mk | 5 +- examples/crd-client/Makefile | 2 +- examples/crd-client/create-gs.yaml | 2 +- examples/crd-client/main.go | 4 +- examples/fleet.yaml | 4 +- examples/gameserver.yaml | 6 +- .../.dockerignore | 2 +- .../Dockerfile.windows | 4 +- examples/simple-game-server/Makefile | 63 ++- .../simple-game-server/fleet-distributed.yaml | 4 +- .../gameserver-passthrough.yaml | 4 +- .../gameserver-windows.yaml | 14 +- examples/simple-game-server/gameserver.yaml | 4 +- examples/simple-tcp/Dockerfile | 32 -- examples/simple-tcp/Dockerfile.windows | 31 -- examples/simple-tcp/Makefile | 103 ----- examples/simple-tcp/README.md | 46 -- examples/simple-tcp/gameserver-windows.yaml | 39 -- examples/simple-tcp/gameserver.yaml | 36 -- examples/simple-tcp/main.go | 144 ------ examples/simple-udp/.dockerignore | 15 - examples/simple-udp/Dockerfile | 32 -- examples/simple-udp/Makefile | 103 ----- examples/simple-udp/README.md | 14 - examples/simple-udp/dev-gameserver.yaml | 34 -- examples/simple-udp/fleet-distributed.yaml | 42 -- examples/simple-udp/fleet.yaml | 37 -- examples/simple-udp/fleetautoscaler.yaml | 31 -- .../simple-udp/gameserver-passthrough.yaml | 37 -- examples/simple-udp/gameserver.yaml | 35 -- examples/simple-udp/gameserverallocation.yaml | 29 -- examples/simple-udp/gameserverset.yaml | 34 -- examples/simple-udp/main.go | 425 ------------------ examples/webhookfleetautoscaler.yaml | 2 +- examples/webhookfleetautoscalertls.yaml | 2 +- .../agones/templates/tests/test-runner.yaml | 2 +- pkg/util/webhooks/webhooks_test.go | 2 +- site/config.toml | 2 +- .../en/docs/Advanced/limiting-resources.md | 4 +- .../Advanced/scheduling-and-autoscaling.md | 8 +- .../en/docs/Advanced/service-accounts.md | 4 +- site/content/en/docs/Examples/_index.md | 25 +- .../en/docs/Getting Started/create-fleet.md | 106 ++--- .../Getting Started/create-fleetautoscaler.md | 67 ++- .../docs/Getting Started/create-gameserver.md | 32 +- .../create-webhook-fleetautoscaler.md | 48 +- .../edit-first-gameserver-go.md | 20 +- .../en/docs/Guides/Client SDKs/local.md | 2 +- site/content/en/docs/Guides/access-api.md | 26 +- .../en/docs/Guides/local-game-server.md | 4 +- .../content/en/docs/Guides/troubleshooting.md | 80 ++-- site/content/en/docs/Reference/fleet.md | 16 +- .../en/docs/Reference/fleetautoscaler.md | 2 +- site/content/en/docs/Reference/gameserver.md | 6 +- test/load/allocation/README.md | 3 +- test/load/allocation/allocationload.go | 2 +- test/load/allocation/fleet.yaml | 6 +- test/load/allocation/grpc/README.md | 15 +- test/load/allocation/grpc/fleet.yaml | 6 +- test/load/locust-files/fleet_autoscaling.py | 14 +- .../locust-files/gameserver_allocation.py | 4 +- 64 files changed, 345 insertions(+), 1588 deletions(-) rename examples/{simple-tcp => simple-game-server}/.dockerignore (95%) rename examples/{simple-udp => simple-game-server}/Dockerfile.windows (90%) rename examples/{simple-udp => simple-game-server}/gameserver-windows.yaml (80%) delete mode 100644 examples/simple-tcp/Dockerfile delete mode 100644 examples/simple-tcp/Dockerfile.windows delete mode 100644 examples/simple-tcp/Makefile delete mode 100644 examples/simple-tcp/README.md delete mode 100644 examples/simple-tcp/gameserver-windows.yaml delete mode 100644 examples/simple-tcp/gameserver.yaml delete mode 100644 examples/simple-tcp/main.go delete mode 100644 examples/simple-udp/.dockerignore delete mode 100644 examples/simple-udp/Dockerfile delete mode 100644 examples/simple-udp/Makefile delete mode 100644 examples/simple-udp/README.md delete mode 100644 examples/simple-udp/dev-gameserver.yaml delete mode 100644 examples/simple-udp/fleet-distributed.yaml delete mode 100644 examples/simple-udp/fleet.yaml delete mode 100644 examples/simple-udp/fleetautoscaler.yaml delete mode 100644 examples/simple-udp/gameserver-passthrough.yaml delete mode 100644 examples/simple-udp/gameserver.yaml delete mode 100644 examples/simple-udp/gameserverallocation.yaml delete mode 100644 examples/simple-udp/gameserverset.yaml delete mode 100644 examples/simple-udp/main.go diff --git a/build/Makefile b/build/Makefile index d7952f0ae2..56f06bc156 100644 --- a/build/Makefile +++ b/build/Makefile @@ -53,7 +53,7 @@ WINDOWS_VERSIONS = ltsc2019 # 1909 (For GKE WINDOWS_SAC support) BUILD_WINDOWS_IMAGE = # Specify stress test level 1..100 -# STRESS_TEST_LEVEL=n requires capacity between 50*n up to 100*n simple-udp Game Servers. +# STRESS_TEST_LEVEL=n requires capacity between 50*n up to 100*n simple-game-server Game Servers. STRESS_TEST_LEVEL ?= 20 # kind cluster name to use diff --git a/build/includes/examples.mk b/build/includes/examples.mk index 86e29814e8..fe1fb2fa71 100644 --- a/build/includes/examples.mk +++ b/build/includes/examples.mk @@ -28,8 +28,6 @@ test-examples-on-gcr: example-image-test.autoscaler-webhook test-examples-on-gcr: example-image-test.cpp-simple test-examples-on-gcr: example-image-test.nodejs-simple test-examples-on-gcr: example-image-test.rust-simple -test-examples-on-gcr: example-image-test.simple-tcp -test-examples-on-gcr: example-image-test.simple-udp test-examples-on-gcr: example-image-test.unity-simple test-examples-on-gcr: example-image-test.xonotic test-examples-on-gcr: example-image-test.crd-client diff --git a/build/includes/release.mk b/build/includes/release.mk index 6afa8b8a7e..536938c592 100644 --- a/build/includes/release.mk +++ b/build/includes/release.mk @@ -43,8 +43,6 @@ release-example-image-markdown: example-image-markdown.crd-client release-example-image-markdown: example-image-markdown.nodejs-simple release-example-image-markdown: example-image-markdown.rust-simple release-example-image-markdown: example-image-markdown.simple-game-server -release-example-image-markdown: example-image-markdown.simple-tcp -release-example-image-markdown: example-image-markdown.simple-udp release-example-image-markdown: example-image-markdown.supertuxkart release-example-image-markdown: example-image-markdown.unity-simple release-example-image-markdown: example-image-markdown.xonotic diff --git a/build/includes/sdk.mk b/build/includes/sdk.mk index 0724390d1e..e1bf2eed76 100644 --- a/build/includes/sdk.mk +++ b/build/includes/sdk.mk @@ -211,7 +211,7 @@ sdk-publish-csharp: $(MAKE) run-sdk-command-csharp COMMAND=publish VERSION=$(RELEASE_VERSION) DOCKER_RUN_ARGS="$(DOCKER_RUN_ARGS) -it" # Perform make build for all examples -build-examples: build-example-xonotic build-example-cpp-simple build-example-simple-udp build-example-autoscaler-webhook build-example-nodejs-simple +build-examples: build-example-xonotic build-example-cpp-simple build-example-autoscaler-webhook build-example-nodejs-simple # Run "make build" command for one example directory build-example: @@ -228,9 +228,6 @@ build-example-xonotic: build-example-cpp-simple: $(MAKE) build-example EXAMPLE=cpp-simple -build-example-simple-udp: - $(MAKE) build-example EXAMPLE=simple-udp - build-example-rust-simple: $(MAKE) build-example EXAMPLE=rust-simple diff --git a/examples/crd-client/Makefile b/examples/crd-client/Makefile index 825d1a4ff5..39e1c93455 100644 --- a/examples/crd-client/Makefile +++ b/examples/crd-client/Makefile @@ -25,7 +25,7 @@ REPOSITORY ?= gcr.io/agones-images -server_tag = $(REPOSITORY)/crd-client:0.4 +server_tag = $(REPOSITORY)/crd-client:0.5 # _____ _ # |_ _|_ _ _ __ __ _ ___| |_ ___ diff --git a/examples/crd-client/create-gs.yaml b/examples/crd-client/create-gs.yaml index 48e12bfb8f..0304d8737c 100644 --- a/examples/crd-client/create-gs.yaml +++ b/examples/crd-client/create-gs.yaml @@ -28,5 +28,5 @@ spec: imagePullPolicy: Always env: - name: GAMESERVER_IMAGE - value: "gcr.io/agones-images/udp-server:0.21" + value: "gcr.io/agones-images/simple-game-server:0.1" restartPolicy: Never diff --git a/examples/crd-client/main.go b/examples/crd-client/main.go index 2e2e16f7f3..b798aea797 100644 --- a/examples/crd-client/main.go +++ b/examples/crd-client/main.go @@ -89,7 +89,7 @@ func main() { Namespace: viper.GetString(gameserversNamespace), }, Spec: agonesv1.GameServerSpec{ - Container: "udp-server", + Container: "simple-game-server", Ports: []agonesv1.GameServerPort{{ ContainerPort: 7654, HostPort: 7654, @@ -101,7 +101,7 @@ func main() { Spec: corev1.PodSpec{ Containers: []corev1.Container{ { - Name: "udp-server", + Name: "simple-game-server", Image: viper.GetString(gameServerImage), }, }, diff --git a/examples/fleet.yaml b/examples/fleet.yaml index 3858ecba54..f3af7430ef 100644 --- a/examples/fleet.yaml +++ b/examples/fleet.yaml @@ -75,5 +75,5 @@ spec: template: spec: containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 \ No newline at end of file + - name: simple-game-server + image: gcr.io/agones-images/simple-game-server:0.1 \ No newline at end of file diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index 8d9ba526ce..f529eb87c5 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -45,7 +45,7 @@ spec: # This will mean that users will need to lookup what port has been opened through the server side SDK. portPolicy: Static # The name of the container to open the port on. Defaults to the game server container if omitted or empty. - container: simple-udp + container: simple-game-server # the port that is being opened on the game server process containerPort: 7654 # the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic". @@ -95,6 +95,6 @@ spec: # Pod Specification spec: containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 + - name: simple-game-server + image: gcr.io/agones-images/simple-game-server:0.1 imagePullPolicy: Always diff --git a/examples/simple-tcp/.dockerignore b/examples/simple-game-server/.dockerignore similarity index 95% rename from examples/simple-tcp/.dockerignore rename to examples/simple-game-server/.dockerignore index 2810ccbbfd..5515cf05d1 100644 --- a/examples/simple-tcp/.dockerignore +++ b/examples/simple-game-server/.dockerignore @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -!bin/simple-tcp.exe +!bin/simple-game-server.exe diff --git a/examples/simple-udp/Dockerfile.windows b/examples/simple-game-server/Dockerfile.windows similarity index 90% rename from examples/simple-udp/Dockerfile.windows rename to examples/simple-game-server/Dockerfile.windows index 1fc6b1c4a6..e2f14d67d4 100644 --- a/examples/simple-udp/Dockerfile.windows +++ b/examples/simple-game-server/Dockerfile.windows @@ -23,9 +23,9 @@ FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION} # Unlike the Linux image the binary is built on the host since buildx cannot # invoke RUN commands for Windows Containers and multi-stage images # cannot copy data between OSes. -COPY ["bin/simple-udp.exe", "/server/simple-udp.exe"] +COPY ["bin/simple-game-server.exe", "/server/simple-game-server.exe"] WORKDIR /server EXPOSE 7654 USER ContainerUser -ENTRYPOINT ["C:\\server\\simple-udp.exe"] +ENTRYPOINT ["C:\\server\\simple-game-server.exe"] diff --git a/examples/simple-game-server/Makefile b/examples/simple-game-server/Makefile index 6b92d112aa..e7ac76490f 100644 --- a/examples/simple-game-server/Makefile +++ b/examples/simple-game-server/Makefile @@ -23,11 +23,19 @@ # \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ # -REPOSITORY = gcr.io/agones-images +REGISTRY = gcr.io/agones-images +BUILDX_WINDOWS_BUILDER = windows-builder +WINDOWS_VERSIONS = ltsc2019 # 1909 (For GKE WINDOWS_SAC support) +WINDOWS_DOCKER_PUSH_ARGS = # When pushing set to --push. mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) project_path := $(dir $(mkfile_path)) -server_tag = $(REPOSITORY)/simple-game-server:0.1 +server_tag = $(REGISTRY)/simple-game-server:0.1 +ifdef WITH_WINDOWS +server_tag_linux_amd64 = $(server_tag)-linux_amd64 +else +server_tag_linux_amd64 = $(server_tag) +endif root_path = $(realpath $(project_path)/../..) # _____ _ @@ -37,9 +45,56 @@ root_path = $(realpath $(project_path)/../..) # |_|\__,_|_| \__, |\___|\__|___/ # |___/ +ifdef WITH_WINDOWS +push: push-multi-arch-image +build: build-linux-image $(foreach winver, $(WINDOWS_VERSIONS), build-windows-image-$(winver)) +else +push: push-linux-image +build: build-linux-image +endif + +# Builds all image artifacts and create a docker manifest that is used to inform the CRI (Docker or containerd usually) +# which image is the best fit for the host. See https://www.docker.com/blog/multi-arch-images/ for details. +push-multi-arch-image: push-linux-image push-windows-images + # TODO: `docker manifest` does not yet stamp the `os.version` for Windows manifest entry. + # This means only 1 Windows version can be supported in a multi-platform build. + # Either adopt, https://github.com/kubernetes-sigs/azuredisk-csi-driver/pull/585/files or + # wait for https://github.com/docker/cli/pull/2578 to be available in Docker 20.10. + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(server_tag) $(server_tag_linux_amd64) $(foreach windows_version, $(WINDOWS_VERSIONS), $(server_tag)-windows_amd64-$(windows_version)) + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(server_tag) --purge + +# Pushes all variants of the Windows images to the container image registry. +push-linux-image: build + docker push $(server_tag_linux_amd64) + +# Pushes all variants of the Windows images to the container image registry. +push-windows-images: $(foreach winver, $(WINDOWS_VERSIONS), push-windows-image-$(winver)) + +# Pushes a specific version of Windows to a container image registry. +push-windows-image-%: + $(MAKE) WINDOWS_DOCKER_PUSH_ARGS=--push build-windows-image-$* + +build-windows-image-%: build-windows-binary ensure-windows-buildx + # TODO: Use `--builder $(BUILDX_WINDOWS_BUILDER)` later once Docker 19.03.13 is the build target. Cloud Build has 19.03.08 https://cloud.google.com/cloud-build/release-notes + cd $(root_path) && DOCKER_CLI_EXPERIMENTAL=enabled \ + docker buildx build --platform windows/amd64 -f $(project_path)Dockerfile.windows \ + --tag=$(server_tag)-windows_amd64-$* --build-arg WINDOWS_VERSION=$* examples/simple-game-server/ $(WINDOWS_DOCKER_PUSH_ARGS) + +# Builds the server binary for Windows (amd64). +build-windows-binary: + GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o bin/simple-game-server.exe main.go + +ensure-windows-buildx: + # TODO: Remove `--use` and specify `--builder` for each buildx command once Docker 19.03.13 is available. + # `--use` sets the global default buildx context to $(BUILDX_WINDOWS_BUILDER). + # + # Windows image builds must be directed to a specific buildx context. + # The default context does not support building cross platform images. + -DOCKER_CLI_EXPERIMENTAL=enabled docker buildx create --name=$(BUILDX_WINDOWS_BUILDER) --use + # Build a docker image for the server, and tag it -build: - cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(server_tag) . +build-linux-image: + cd $(root_path) && docker build -f $(project_path)Dockerfile --tag=$(server_tag_linux_amd64) . # check if hosted on Google Cloud Registry gcr-check: diff --git a/examples/simple-game-server/fleet-distributed.yaml b/examples/simple-game-server/fleet-distributed.yaml index 6756c09cf6..4069e1e820 100644 --- a/examples/simple-game-server/fleet-distributed.yaml +++ b/examples/simple-game-server/fleet-distributed.yaml @@ -35,8 +35,8 @@ spec: image: gcr.io/agones-images/simple-game-server:0.1 resources: requests: - memory: "32Mi" + memory: "64Mi" cpu: "20m" limits: - memory: "32Mi" + memory: "64Mi" cpu: "20m" diff --git a/examples/simple-game-server/gameserver-passthrough.yaml b/examples/simple-game-server/gameserver-passthrough.yaml index 79f9664386..de5c3202dc 100644 --- a/examples/simple-game-server/gameserver-passthrough.yaml +++ b/examples/simple-game-server/gameserver-passthrough.yaml @@ -30,8 +30,8 @@ spec: value: "TRUE" resources: requests: - memory: "32Mi" + memory: "64Mi" cpu: "20m" limits: - memory: "32Mi" + memory: "64Mi" cpu: "20m" diff --git a/examples/simple-udp/gameserver-windows.yaml b/examples/simple-game-server/gameserver-windows.yaml similarity index 80% rename from examples/simple-udp/gameserver-windows.yaml rename to examples/simple-game-server/gameserver-windows.yaml index eaafd4faf0..f3b86e5bbd 100644 --- a/examples/simple-udp/gameserver-windows.yaml +++ b/examples/simple-game-server/gameserver-windows.yaml @@ -15,7 +15,7 @@ apiVersion: "agones.dev/v1" kind: GameServer metadata: - generateName: "simple-udp-" + generateName: "simple-game-server-" spec: ports: - name: default @@ -24,15 +24,15 @@ spec: template: spec: containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 + - name: simple-game-server + image: gcr.io/agones-images/simple-game-server:0.1 resources: requests: - memory: "256Mi" - cpu: "500m" + memory: "64Mi" + cpu: "20m" limits: - memory: "512Mi" - cpu: "500m" + memory: "64Mi" + cpu: "20m" # Limit this pod to Windows nodes. nodeSelector: kubernetes.io/os: windows diff --git a/examples/simple-game-server/gameserver.yaml b/examples/simple-game-server/gameserver.yaml index 97dc202c2f..eff38a7164 100644 --- a/examples/simple-game-server/gameserver.yaml +++ b/examples/simple-game-server/gameserver.yaml @@ -28,8 +28,8 @@ spec: image: gcr.io/agones-images/simple-game-server:0.1 resources: requests: - memory: "32Mi" + memory: "64Mi" cpu: "20m" limits: - memory: "32Mi" + memory: "64Mi" cpu: "20m" diff --git a/examples/simple-tcp/Dockerfile b/examples/simple-tcp/Dockerfile deleted file mode 100644 index 018aa3457c..0000000000 --- a/examples/simple-tcp/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2019 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# build -FROM golang:1.14.12 as builder -WORKDIR /go/src/simple-tcp - -COPY examples/simple-tcp/main.go . -COPY . /go/src/agones.dev/agones -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server . - -# final image -FROM alpine:3.11 - -RUN adduser -D -u 1000 server -COPY --from=builder /go/src/simple-tcp/server /home/server/server -RUN chown -R server /home/server && \ - chmod o+x /home/server/server - -USER 1000 -ENTRYPOINT ["/home/server/server"] diff --git a/examples/simple-tcp/Dockerfile.windows b/examples/simple-tcp/Dockerfile.windows deleted file mode 100644 index c150024b31..0000000000 --- a/examples/simple-tcp/Dockerfile.windows +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2020 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Windows Containers have a strong host compatibility requirement. -# Use `--build-arg WINDOWS_VERSION=` to select the correct base image -# See https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility -# for details. -ARG WINDOWS_VERSION=ltsc2019 - -FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION} - -# Unlike the Linux image the binary is built on the host since buildx cannot -# invoke RUN commands for Windows Containers and multi-stage images -# cannot copy data between OSes. -COPY ["bin/simple-tcp.exe", "/server/simple-tcp.exe"] - -WORKDIR /server -EXPOSE 7654 -USER ContainerUser -ENTRYPOINT ["C:\\server\\simple-tcp.exe"] diff --git a/examples/simple-tcp/Makefile b/examples/simple-tcp/Makefile deleted file mode 100644 index 341bb41782..0000000000 --- a/examples/simple-tcp/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2019 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Makefile for building a simple tcp server -# - -# __ __ _ _ _ -# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ -# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| -# \ V / (_| | | | | (_| | |_) | | __\__ \ -# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ -# - -REPOSITORY = gcr.io/agones-images -BUILDX_WINDOWS_BUILDER = windows-builder -WINDOWS_VERSIONS = ltsc2019 # 1909 (For GKE WINDOWS_SAC support) -WINDOWS_DOCKER_PUSH_ARGS = # When pushing set to --push. - -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -project_path := $(dir $(mkfile_path)) -server_tag = $(REPOSITORY)/tcp-server:0.4 -ifdef WITH_WINDOWS -server_tag_linux_amd64 = $(server_tag)-linux_amd64 -else -server_tag_linux_amd64 = $(server_tag) -endif -root_path = $(realpath $(project_path)/../..) - -# _____ _ -# |_ _|_ _ _ __ __ _ ___| |_ ___ -# | |/ _` | '__/ _` |/ _ \ __/ __| -# | | (_| | | | (_| | __/ |_\__ \ -# |_|\__,_|_| \__, |\___|\__|___/ -# |___/ - -ifdef WITH_WINDOWS -push: push-multi-arch-image -build: build-linux-image $(foreach winver, $(WINDOWS_VERSIONS), build-windows-image-$(winver)) -else -push: push-linux-image -build: build-linux-image -endif - -# Builds all image artifacts and create a docker manifest that is used to inform the CRI (Docker or containerd usually) -# which image is the best fit for the host. See https://www.docker.com/blog/multi-arch-images/ for details. -push-multi-arch-image: push-linux-image push-windows-images - # TODO: `docker manifest` does not yet stamp the `os.version` for Windows manifest entry. - # This means only 1 Windows version can be supported in a multi-platform build. - # Either adopt, https://github.com/kubernetes-sigs/azuredisk-csi-driver/pull/585/files or - # wait for https://github.com/docker/cli/pull/2578 to be available in Docker 20.10. - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(server_tag) $(server_tag_linux_amd64) $(foreach windows_version, $(WINDOWS_VERSIONS), $(server_tag)-windows_amd64-$(windows_version)) - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(server_tag) --purge - -# Pushes all variants of the Windows images to the container image registry. -push-linux-image: build - docker push $(server_tag_linux_amd64) - -# Pushes all variants of the Windows images to the container image registry. -push-windows-images: $(foreach winver, $(WINDOWS_VERSIONS), push-windows-image-$(winver)) - -# Pushes a specific version of Windows to a container image registry. -push-windows-image-%: - $(MAKE) WINDOWS_DOCKER_PUSH_ARGS=--push build-windows-image-$* - -build-windows-image-%: build-windows-binary ensure-windows-buildx - # TODO: Use `--builder $(BUILDX_WINDOWS_BUILDER)` later once Docker 19.03.13 is the build target. - cd $(root_path) && DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform windows/amd64 -f $(project_path)Dockerfile.windows --tag=$(server_tag)-windows_amd64-$* --build-arg WINDOWS_VERSION=$* examples/simple-tcp/ $(WINDOWS_DOCKER_PUSH_ARGS) - -# Builds the server binary for Windows (amd64). -build-windows-binary: - GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o bin/simple-tcp.exe main.go - -ensure-windows-buildx: - # TODO: Remove `--use` and specify `--builder` for each buildx command once Docker 19.03.13 is available. - # `--use` sets the global default buildx context to $(BUILDX_WINDOWS_BUILDER). - # - # Windows image builds must be directed to a specific buildx context. - # The default context does not support building cross platform images. - -DOCKER_CLI_EXPERIMENTAL=enabled docker buildx create --name=$(BUILDX_WINDOWS_BUILDER) --use - -# Build a docker image for the server, and tag it -build-linux-image: - cd $(root_path) && docker build -f $(project_path)Dockerfile --tag=$(server_tag_linux_amd64) . - -# check if hosted on Google Cloud Registry -gcr-check: - gcloud container images describe $(server_tag) - -#output the tag for this image -echo-image-tag: - @echo $(server_tag) \ No newline at end of file diff --git a/examples/simple-tcp/README.md b/examples/simple-tcp/README.md deleted file mode 100644 index 7baa37aa7a..0000000000 --- a/examples/simple-tcp/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Simple TCP Server - -A very simple game server, for the purposes of testing a TCP based server on Agones. - -## Server -Starts a server on port `7654` by default. Can be overwritten by `PORT` env var or `port` flag. - -When it receives a text message ending with a newline, it will send back "ACK:" as an echo. - -If it receives the text "EXIT", then it will `sys.Exit(0)` - -## Firewalls - -If you plan to access your server remotely, you may need to open up a hole in your -firewall. - -For example, if you created a cluster running on Google Kubernetes Engine following -the installation guide, you can create a firewall rule to allow TCP traffic to nodes -tagged as game-server via ports 7000-8000. - -```bash -gcloud compute firewall-rules create game-server-firewall-tcp \ - --allow tcp:7000-8000 \ - --target-tags game-server \ - --description "Firewall to allow game server udp traffic" -``` - -## Testing - -```bash -# Get the GameServer definition -$ kubectl get gs -NAME STATE ADDRESS PORT NODE AGE -simple-tcp-6mwwn Unhealthy 34.105.58.178 7685 gke-xonotic-xonotic-windows-8bb8ecec-qpjg 35m -simple-tcp-6rkk7 Unhealthy 34.105.58.178 7032 gke-xonotic-xonotic-windows-8bb8ecec-qpjg 69m -simple-tcp-b4ccz Ready 34.105.58.178 7627 gke-xonotic-xonotic-windows-8bb8ecec-qpjg 14m -simple-tcp-d9dfc Ready 34.83.210.144 7083 gke-xonotic-default-pool-14f8be3d-j2hj 5m41s -simple-tcp-lfns5 Unhealthy 34.105.58.178 7051 gke-xonotic-xonotic-windows-8bb8ecec-qpjg 15m -simple-tcp-rdchv Ready 34.105.58.178 7654 gke-xonotic-xonotic-windows-8bb8ecec-qpjg 6m36s -simple-tcp-wprpp Unhealthy 34.105.58.178 7584 gke-xonotic-xonotic-windows-8bb8ecec-qpjg 70m - -# Use Netcat -$ nc 34.83.210.144 7083 -Hello Agones -ACK: Hello Agones -``` diff --git a/examples/simple-tcp/gameserver-windows.yaml b/examples/simple-tcp/gameserver-windows.yaml deleted file mode 100644 index 884b632118..0000000000 --- a/examples/simple-tcp/gameserver-windows.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: "agones.dev/v1" -kind: GameServer -metadata: - generateName: "simple-tcp-" -spec: - ports: - - name: default - portPolicy: Dynamic - containerPort: 7654 - protocol: TCP - template: - spec: - containers: - - name: simple-tcp - image: gcr.io/agones-images/tcp-server:0.4 - resources: - requests: - memory: "512Mi" - cpu: 2 - limits: - memory: "512Mi" - cpu: 2 - # Limit this pod to Windows nodes. - nodeSelector: - kubernetes.io/os: windows diff --git a/examples/simple-tcp/gameserver.yaml b/examples/simple-tcp/gameserver.yaml deleted file mode 100644 index 18605146f4..0000000000 --- a/examples/simple-tcp/gameserver.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2019 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: "agones.dev/v1" -kind: GameServer -metadata: - generateName: "simple-tcp-" -spec: - ports: - - name: default - portPolicy: Dynamic - containerPort: 7654 - protocol: TCP - template: - spec: - containers: - - name: simple-tcp - image: gcr.io/agones-images/tcp-server:0.4 - resources: - requests: - memory: "32Mi" - cpu: "20m" - limits: - memory: "32Mi" - cpu: "20m" diff --git a/examples/simple-tcp/main.go b/examples/simple-tcp/main.go deleted file mode 100644 index 3e3f129547..0000000000 --- a/examples/simple-tcp/main.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2019 Google LLC All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package main is a very simple echo TCP server -package main - -import ( - "bufio" - "flag" - "log" - "net" - "os" - "strings" - "time" - - "agones.dev/agones/pkg/util/signals" - sdk "agones.dev/agones/sdks/go" -) - -// main starts a TCP server that receives a message at a time -// (newline delineated), and echos the output. -func main() { - go doSignal() - - port := flag.String("port", "7654", "The port to listen to tcp traffic on") - flag.Parse() - if ep := os.Getenv("PORT"); ep != "" { - port = &ep - } - - log.Printf("Starting TCP server, listening on port %s", *port) - ln, err := net.Listen("tcp", ":"+*port) - if err != nil { - log.Fatalf("Could not start tcp server: %v", err) - } - defer ln.Close() // nolint: errcheck - - log.Print("Creating SDK instance") - s, err := sdk.NewSDK() - if err != nil { - log.Fatalf("Could not connect to sdk: %v", err) - } - - log.Print("Starting Health Ping") - stop := make(chan struct{}) - go doHealth(s, stop) - - log.Print("Marking this server as ready") - if err := s.Ready(); err != nil { - log.Fatalf("Could not send ready message") - } - - for { - conn, err := ln.Accept() - if err != nil { - log.Printf("Unable to accept incoming tcp connection: %v", err) - } - go handleConnection(conn, stop, s) - } -} - -// doSignal shutsdown on SIGTERM/SIGKILL -func doSignal() { - stop := signals.NewStopChannel() - <-stop - log.Println("Exit signal received. Shutting down.") - os.Exit(0) -} - -// handleConnection services a single tcp connection to the server -func handleConnection(conn net.Conn, stop chan struct{}, s *sdk.SDK) { - log.Printf("Client %s connected", conn.RemoteAddr().String()) - scanner := bufio.NewScanner(conn) - for { - if ok := scanner.Scan(); !ok { - log.Printf("Client %s disconnected", conn.RemoteAddr().String()) - return - } - handleCommand(conn, scanner.Text(), stop, s) - } -} - -// respond responds to a given sender. -func respond(conn net.Conn, txt string) { - log.Printf("Responding with %q", txt) - if _, err := conn.Write([]byte(txt+"\n")); err != nil { - log.Fatalf("Could not write to tcp stream: %v", err) - } -} - -func handleCommand(conn net.Conn, txt string, stop chan struct{}, s *sdk.SDK) { - parts := strings.Split(strings.TrimSpace(txt), " ") - - log.Printf("parts: %v", parts) - switch parts[0] { - // shuts down the gameserver - case "EXIT": - respond(conn, "ACK: "+txt) - exit(s) - - // turns off the health pings - case "UNHEALTHY": - close(stop) - } - - respond(conn, "ACK: "+txt+"\n") -} - -// exit shutdowns the server -func exit(s *sdk.SDK) { - log.Printf("Received EXIT command. Exiting.") - // This tells Agones to shutdown this Game Server - if err := s.Shutdown(); err != nil { - log.Printf("Could not call shutdown: %v", err) - } - os.Exit(0) -} - -// doHealth sends the regular Health Pings -func doHealth(sdk *sdk.SDK, stop <-chan struct{}) { - tick := time.Tick(2 * time.Second) - for { - if err := sdk.Health(); err != nil { - log.Fatalf("Could not send health ping: %v", err) - } - select { - case <-stop: - log.Print("Stopped health pings") - return - case <-tick: - } - } -} diff --git a/examples/simple-udp/.dockerignore b/examples/simple-udp/.dockerignore deleted file mode 100644 index c63854a30e..0000000000 --- a/examples/simple-udp/.dockerignore +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -!bin/simple-udp.exe diff --git a/examples/simple-udp/Dockerfile b/examples/simple-udp/Dockerfile deleted file mode 100644 index 1ad1e2f8b8..0000000000 --- a/examples/simple-udp/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2017 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# build -FROM golang:1.14.12 as builder -WORKDIR /go/src/simple-udp - -COPY examples/simple-udp/main.go . -COPY . /go/src/agones.dev/agones -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server . - -# final image -FROM alpine:3.11 - -RUN adduser -D -u 1000 server -COPY --from=builder /go/src/simple-udp/server /home/server/server -RUN chown -R server /home/server && \ - chmod o+x /home/server/server - -USER 1000 -ENTRYPOINT ["/home/server/server"] diff --git a/examples/simple-udp/Makefile b/examples/simple-udp/Makefile deleted file mode 100644 index 7367888762..0000000000 --- a/examples/simple-udp/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2017 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Makefile for building a simple udp client and server -# - -# __ __ _ _ _ -# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ -# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| -# \ V / (_| | | | | (_| | |_) | | __\__ \ -# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ -# - -REPOSITORY = gcr.io/agones-images -BUILDX_WINDOWS_BUILDER = windows-builder -WINDOWS_VERSIONS = ltsc2019 # 1909 (For GKE WINDOWS_SAC support) -WINDOWS_DOCKER_PUSH_ARGS = # When pushing set to --push. - -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -project_path := $(dir $(mkfile_path)) -server_tag = $(REPOSITORY)/udp-server:0.21 -ifdef WITH_WINDOWS -server_tag_linux_amd64 = $(server_tag)-linux_amd64 -else -server_tag_linux_amd64 = $(server_tag) -endif -root_path = $(realpath $(project_path)/../..) - -# _____ _ -# |_ _|_ _ _ __ __ _ ___| |_ ___ -# | |/ _` | '__/ _` |/ _ \ __/ __| -# | | (_| | | | (_| | __/ |_\__ \ -# |_|\__,_|_| \__, |\___|\__|___/ -# |___/ - -ifdef WITH_WINDOWS -push: push-multi-arch-image -build: build-linux-image $(foreach winver, $(WINDOWS_VERSIONS), build-windows-image-$(winver)) -else -push: push-linux-image -build: build-linux-image -endif - -# Builds all image artifacts and create a docker manifest that is used to inform the CRI (Docker or containerd usually) -# which image is the best fit for the host. See https://www.docker.com/blog/multi-arch-images/ for details. -push-multi-arch-image: push-linux-image push-windows-images - # TODO: `docker manifest` does not yet stamp the `os.version` for Windows manifest entry. - # This means only 1 Windows version can be supported in a multi-platform build. - # Either adopt, https://github.com/kubernetes-sigs/azuredisk-csi-driver/pull/585/files or - # wait for https://github.com/docker/cli/pull/2578 to be available in Docker 20.10. - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(server_tag) $(server_tag_linux_amd64) $(foreach windows_version, $(WINDOWS_VERSIONS), $(server_tag)-windows_amd64-$(windows_version)) - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(server_tag) --purge - -# Pushes all variants of the Windows images to the container image registry. -push-linux-image: build - docker push $(server_tag_linux_amd64) - -# Pushes all variants of the Windows images to the container image registry. -push-windows-images: $(foreach winver, $(WINDOWS_VERSIONS), push-windows-image-$(winver)) - -# Pushes a specific version of Windows to a container image registry. -push-windows-image-%: - $(MAKE) WINDOWS_DOCKER_PUSH_ARGS=--push build-windows-image-$* - -build-windows-image-%: build-windows-binary ensure-windows-buildx - # TODO: Use `--builder $(BUILDX_WINDOWS_BUILDER)` later once Docker 19.03.13 is the build target. Cloud Build has 19.03.08 https://cloud.google.com/cloud-build/release-notes - cd $(root_path) && DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform windows/amd64 -f $(project_path)Dockerfile.windows --tag=$(server_tag)-windows_amd64-$* --build-arg WINDOWS_VERSION=$* examples/simple-udp/ $(WINDOWS_DOCKER_PUSH_ARGS) - -# Builds the server binary for Windows (amd64). -build-windows-binary: - GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o bin/simple-udp.exe main.go - -ensure-windows-buildx: - # TODO: Remove `--use` and specify `--builder` for each buildx command once Docker 19.03.13 is available. - # `--use` sets the global default buildx context to $(BUILDX_WINDOWS_BUILDER). - # - # Windows image builds must be directed to a specific buildx context. - # The default context does not support building cross platform images. - -DOCKER_CLI_EXPERIMENTAL=enabled docker buildx create --name=$(BUILDX_WINDOWS_BUILDER) --use - -# Build a docker image for the server, and tag it -build-linux-image: - cd $(root_path) && docker build -f $(project_path)Dockerfile --tag=$(server_tag_linux_amd64) . - -# check if hosted on Google Cloud Registry -gcr-check: - gcloud container images describe $(server_tag) - -#output the tag for this image -echo-image-tag: - @echo $(server_tag) \ No newline at end of file diff --git a/examples/simple-udp/README.md b/examples/simple-udp/README.md deleted file mode 100644 index 3593380ff4..0000000000 --- a/examples/simple-udp/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Simple UDP Server - -A very simple UDP logging server, for the purposes of demoing and testing -running a UDP based server on Agones. - -## Server -Starts a server on port `7654` by default. Can be overwritten by `PORT` env var or `port` flag. - -When it receives a text packet, it will send back "ACK:" as an echo. - -If it receives the text "EXIT", then it will `sys.Exit(0)` - -To learn how to deploy your edited version of go server to gcp, please check out this link: [Edit Your First Game Server (Go)](https://agones.dev/site/docs/getting-started/edit-first-gameserver-go/), -or also look at the [`Makefile`](./Makefile). diff --git a/examples/simple-udp/dev-gameserver.yaml b/examples/simple-udp/dev-gameserver.yaml deleted file mode 100644 index 7ca1807646..0000000000 --- a/examples/simple-udp/dev-gameserver.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2019 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: "agones.dev/v1" -kind: GameServer -metadata: - name: local-simple-udp - generateName: "simple-udp-" - annotations: - # Causes Agones to register your local game server at 192.1.1.2, replace with your server's IP address. - agones.dev/dev-address: "192.1.1.2" -spec: - ports: - - name: default - portPolicy: Static - hostPort: 17654 - containerPort: 17654 - # The following is ignored but required due to validation. - template: - spec: - containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 diff --git a/examples/simple-udp/fleet-distributed.yaml b/examples/simple-udp/fleet-distributed.yaml deleted file mode 100644 index 46ad71c7de..0000000000 --- a/examples/simple-udp/fleet-distributed.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2019 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# special fleet for load testing where we scale the fleet up/and down -# it uses artificially low resource requests to be able to put as many -# pods on a node as possible. - -apiVersion: "agones.dev/v1" -kind: Fleet -metadata: - name: simple-udp-distributed -spec: - replicas: 0 - scheduling: Distributed - template: - spec: - ports: - - name: default - containerPort: 7654 - template: - spec: - containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 - resources: - requests: - memory: "32Mi" - cpu: "20m" - limits: - memory: "32Mi" - cpu: "20m" diff --git a/examples/simple-udp/fleet.yaml b/examples/simple-udp/fleet.yaml deleted file mode 100644 index af28379000..0000000000 --- a/examples/simple-udp/fleet.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2018 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: "agones.dev/v1" -kind: Fleet -metadata: - name: simple-udp -spec: - replicas: 2 - template: - spec: - ports: - - name: default - containerPort: 7654 - template: - spec: - containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 - resources: - requests: - memory: "64Mi" - cpu: "20m" - limits: - memory: "64Mi" - cpu: "20m" diff --git a/examples/simple-udp/fleetautoscaler.yaml b/examples/simple-udp/fleetautoscaler.yaml deleted file mode 100644 index b2a6717176..0000000000 --- a/examples/simple-udp/fleetautoscaler.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2018 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# A FleetAutoscaler is used to scale the fleet automatically -# up and down depending on usage -# - -apiVersion: "autoscaling.agones.dev/v1" -kind: FleetAutoscaler -metadata: - name: simple-udp-autoscaler -spec: - fleetName: simple-udp - policy: - type: Buffer - buffer: - bufferSize: 2 - minReplicas: 0 - maxReplicas: 10 diff --git a/examples/simple-udp/gameserver-passthrough.yaml b/examples/simple-udp/gameserver-passthrough.yaml deleted file mode 100644 index e1cbcb6dce..0000000000 --- a/examples/simple-udp/gameserver-passthrough.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2017 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: "agones.dev/v1" -kind: GameServer -metadata: - generateName: "simple-udp-" -spec: - ports: - - name: default - portPolicy: Passthrough - template: - spec: - containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 - env: - - name: "PASSTHROUGH" - value: "TRUE" - resources: - requests: - memory: "32Mi" - cpu: "20m" - limits: - memory: "32Mi" - cpu: "20m" diff --git a/examples/simple-udp/gameserver.yaml b/examples/simple-udp/gameserver.yaml deleted file mode 100644 index 424a08fda9..0000000000 --- a/examples/simple-udp/gameserver.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2017 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: "agones.dev/v1" -kind: GameServer -metadata: - generateName: "simple-udp-" -spec: - ports: - - name: default - portPolicy: Dynamic - containerPort: 7654 - template: - spec: - containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 - resources: - requests: - memory: "32Mi" - cpu: "20m" - limits: - memory: "32Mi" - cpu: "20m" diff --git a/examples/simple-udp/gameserverallocation.yaml b/examples/simple-udp/gameserverallocation.yaml deleted file mode 100644 index 3103526886..0000000000 --- a/examples/simple-udp/gameserverallocation.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2018 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# A GameServerAllocation against a Fleet named 'simple-udp' -# - -apiVersion: "allocation.agones.dev/v1" -kind: GameServerAllocation -spec: - # GameServer selector from which to choose GameServers from. - # GameServers still have the hard requirement to be `Ready` to be allocated from - # however we can also make available `matchExpressions` for even greater - # flexibility. - # Below is an example of a GameServer allocated against a given fleet. - required: - matchLabels: - agones.dev/fleet: simple-udp \ No newline at end of file diff --git a/examples/simple-udp/gameserverset.yaml b/examples/simple-udp/gameserverset.yaml deleted file mode 100644 index 58b2de7238..0000000000 --- a/examples/simple-udp/gameserverset.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2018 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Usually you would define a Fleet rather than a GameServerSet -# directly. This is here mostly for testing purposes - -apiVersion: "agones.dev/v1" -kind: GameServerSet -metadata: - name: simple-udp -spec: - replicas: 2 - template: - spec: - ports: - - name: default - portPolicy: Dynamic - containerPort: 7654 - template: - spec: - containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 \ No newline at end of file diff --git a/examples/simple-udp/main.go b/examples/simple-udp/main.go deleted file mode 100644 index 276afab43b..0000000000 --- a/examples/simple-udp/main.go +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2018 Google LLC All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package main is a very simple echo UDP server -package main - -import ( - "encoding/json" - "flag" - "fmt" - "log" - "net" - "os" - "strconv" - "strings" - "time" - - coresdk "agones.dev/agones/pkg/sdk" - "agones.dev/agones/pkg/util/signals" - sdk "agones.dev/agones/sdks/go" -) - -// main starts a UDP server that received 1024 byte sized packets at at time -// converts the bytes to a string, and logs the output -func main() { - go doSignal() - - port := flag.String("port", "7654", "The port to listen to udp traffic on") - passthrough := flag.Bool("passthrough", false, "Get listening port from the SDK, rather than use the 'port' value") - readyOnStart := flag.Bool("ready", true, "Mark this GameServer as Ready on startup") - shutdownDelay := flag.Int("automaticShutdownDelayMin", 0, "If greater than zero, automatically shut down the server this many minutes after the server becomes allocated") - flag.Parse() - if ep := os.Getenv("PORT"); ep != "" { - port = &ep - } - if epass := os.Getenv("PASSTHROUGH"); epass != "" { - p := strings.ToUpper(epass) == "TRUE" - passthrough = &p - } - if eready := os.Getenv("READY"); eready != "" { - r := strings.ToUpper(eready) == "TRUE" - readyOnStart = &r - } - - log.Print("Creating SDK instance") - s, err := sdk.NewSDK() - if err != nil { - log.Fatalf("Could not connect to sdk: %v", err) - } - - log.Print("Starting Health Ping") - stop := make(chan struct{}) - go doHealth(s, stop) - - if *passthrough { - var gs *coresdk.GameServer - gs, err = s.GameServer() - if err != nil { - log.Fatalf("Could not get gameserver port details: %s", err) - } - - p := strconv.FormatInt(int64(gs.Status.Ports[0].Port), 10) - port = &p - } - - log.Printf("Starting UDP server, listening on port %s", *port) - conn, err := net.ListenPacket("udp", ":"+*port) - if err != nil { - log.Fatalf("Could not start udp server: %v", err) - } - defer conn.Close() // nolint: errcheck - - if *readyOnStart { - log.Print("Marking this server as ready") - ready(s) - } - - if *shutdownDelay > 0 { - shutdownAfterAllocation(s, *shutdownDelay) - } - readWriteLoop(conn, stop, s) -} - -// doSignal shutsdown on SIGTERM/SIGKILL -func doSignal() { - stop := signals.NewStopChannel() - <-stop - log.Println("Exit signal received. Shutting down.") - os.Exit(0) -} - -// shutdownAfterAllocation creates a callback to automatically shut down -// the server a specified number of minutes after the server becomes -// allocated. -func shutdownAfterAllocation(s *sdk.SDK, shutdownDelay int) { - err := s.WatchGameServer(func(gs *coresdk.GameServer) { - if gs.Status.State == "Allocated" { - time.Sleep(time.Duration(shutdownDelay) * time.Minute) - shutdownErr := s.Shutdown() - if shutdownErr != nil { - log.Fatalf("Could not shutdown: %v", shutdownErr) - } - } - }) - if err != nil { - log.Fatalf("Could not watch Game Server events, %v", err) - } -} - -func readWriteLoop(conn net.PacketConn, stop chan struct{}, s *sdk.SDK) { - b := make([]byte, 1024) - for { - sender, txt := readPacket(conn, b) - parts := strings.Split(strings.TrimSpace(txt), " ") - - switch parts[0] { - // shuts down the gameserver - case "EXIT": - // respond here, as we os.Exit() before we get to below - respond(conn, sender, "ACK: "+txt+"\n") - exit(s) - - // turns off the health pings - case "UNHEALTHY": - close(stop) - - case "GAMESERVER": - respond(conn, sender, gameServerName(s)) - - case "READY": - ready(s) - - case "ALLOCATE": - allocate(s) - - case "RESERVE": - if len(parts) != 2 { - respond(conn, sender, "ERROR: Invalid RESERVE, should have 1 argument\n") - continue - } - if dur, err := time.ParseDuration(parts[1]); err != nil { - respond(conn, sender, fmt.Sprintf("ERROR: %s\n", err)) - continue - } else { - reserve(s, dur) - } - - case "WATCH": - watchGameServerEvents(s) - - case "LABEL": - switch len(parts) { - case 1: - // legacy format - setLabel(s, "timestamp", strconv.FormatInt(time.Now().Unix(), 10)) - case 3: - setLabel(s, parts[1], parts[2]) - default: - respond(conn, sender, "ERROR: Invalid LABEL command, must use zero or 2 arguments") - continue - } - - case "CRASH": - log.Print("Crashing.") - os.Exit(1) - - case "ANNOTATION": - switch len(parts) { - case 1: - // legacy format - setAnnotation(s, "timestamp", time.Now().UTC().String()) - case 3: - setAnnotation(s, parts[1], parts[2]) - default: - respond(conn, sender, "ERROR: Invalid ANNOTATION command, must use zero or 2 arguments\n") - continue - } - case "PLAYER_CAPACITY": - switch len(parts) { - case 1: - respond(conn, sender, getPlayerCapacity(s)) - continue - case 2: - if cap, err := strconv.Atoi(parts[1]); err != nil { - respond(conn, sender, fmt.Sprintf("ERROR: %s\n", err)) - continue - } else { - setPlayerCapacity(s, int64(cap)) - } - default: - respond(conn, sender, "ERROR: Invalid PLAYER_CAPACITY, should have 0 or 1 arguments\n") - continue - } - - case "PLAYER_CONNECT": - if len(parts) < 2 { - respond(conn, sender, "ERROR: Invalid PLAYER_CONNECT, should have 1 arguments\n") - continue - } - playerConnect(s, parts[1]) - - case "PLAYER_DISCONNECT": - if len(parts) < 2 { - respond(conn, sender, "ERROR: Invalid PLAYER_CONNECT, should have 1 arguments\n") - continue - } - playerDisconnect(s, parts[1]) - - case "PLAYER_CONNECTED": - if len(parts) < 2 { - respond(conn, sender, "ERROR: Invalid PLAYER_CONNECTED, should have 1 arguments\n") - continue - } - respond(conn, sender, playerIsConnected(s, parts[1])) - continue - - case "GET_PLAYERS": - respond(conn, sender, getConnectedPlayers(s)) - continue - - case "PLAYER_COUNT": - respond(conn, sender, getPlayerCount(s)) - continue - } - - respond(conn, sender, "ACK: "+txt+"\n") - } -} - -// ready attempts to mark this gameserver as ready -func ready(s *sdk.SDK) { - err := s.Ready() - if err != nil { - log.Fatalf("Could not send ready message") - } -} - -// allocate attempts to allocate this gameserver -func allocate(s *sdk.SDK) { - err := s.Allocate() - if err != nil { - log.Fatalf("could not allocate gameserver: %v", err) - } -} - -// reserve for 10 seconds -func reserve(s *sdk.SDK, duration time.Duration) { - if err := s.Reserve(duration); err != nil { - log.Fatalf("could not reserve gameserver: %v", err) - } -} - -// readPacket reads a string from the connection -func readPacket(conn net.PacketConn, b []byte) (net.Addr, string) { - n, sender, err := conn.ReadFrom(b) - if err != nil { - log.Fatalf("Could not read from udp stream: %v", err) - } - txt := strings.TrimSpace(string(b[:n])) - log.Printf("Received packet from %v: %v", sender.String(), txt) - return sender, txt -} - -// respond responds to a given sender. -func respond(conn net.PacketConn, sender net.Addr, txt string) { - if _, err := conn.WriteTo([]byte(txt), sender); err != nil { - log.Fatalf("Could not write to udp stream: %v", err) - } -} - -// exit shutdowns the server -func exit(s *sdk.SDK) { - log.Printf("Received EXIT command. Exiting.") - // This tells Agones to shutdown this Game Server - shutdownErr := s.Shutdown() - if shutdownErr != nil { - log.Printf("Could not shutdown") - } - os.Exit(0) -} - -// gameServerName returns the GameServer name -func gameServerName(s *sdk.SDK) string { - var gs *coresdk.GameServer - gs, err := s.GameServer() - if err != nil { - log.Fatalf("Could not retrieve GameServer: %v", err) - } - var j []byte - j, err = json.Marshal(gs) - if err != nil { - log.Fatalf("error mashalling GameServer to JSON: %v", err) - } - log.Printf("GameServer: %s \n", string(j)) - return "NAME: " + gs.ObjectMeta.Name + "\n" -} - -// watchGameServerEvents creates a callback to log when -// gameserver events occur -func watchGameServerEvents(s *sdk.SDK) { - err := s.WatchGameServer(func(gs *coresdk.GameServer) { - j, err := json.Marshal(gs) - if err != nil { - log.Fatalf("error mashalling GameServer to JSON: %v", err) - } - log.Printf("GameServer Event: %s \n", string(j)) - }) - if err != nil { - log.Fatalf("Could not watch Game Server events, %v", err) - } -} - -// setAnnotation sets a given annotation -func setAnnotation(s *sdk.SDK, key, value string) { - log.Printf("Setting annotation %v=%v", key, value) - err := s.SetAnnotation(key, value) - if err != nil { - log.Fatalf("could not set annotation: %v", err) - } -} - -// setLabel sets a given label -func setLabel(s *sdk.SDK, key, value string) { - log.Printf("Setting label %v=%v", key, value) - // label values can only be alpha, - and . - err := s.SetLabel(key, value) - if err != nil { - log.Fatalf("could not set label: %v", err) - } -} - -// setPlayerCapacity sets the player capacity to the given value -func setPlayerCapacity(s *sdk.SDK, capacity int64) { - log.Printf("Setting Player Capacity to %d", capacity) - if err := s.Alpha().SetPlayerCapacity(capacity); err != nil { - log.Fatalf("could not set capacity: %v", err) - } -} - -// getPlayerCapacity returns the current player capacity as a string -func getPlayerCapacity(s *sdk.SDK) string { - log.Print("Getting Player Capacity") - capacity, err := s.Alpha().GetPlayerCapacity() - if err != nil { - log.Fatalf("could not get capacity: %v", err) - } - return strconv.FormatInt(capacity, 10) + "\n" -} - -// playerConnect connects a given player -func playerConnect(s *sdk.SDK, id string) { - log.Printf("Connecting Player: %s", id) - if _, err := s.Alpha().PlayerConnect(id); err != nil { - log.Fatalf("could not connect player: %v", err) - } -} - -// playerDisconnect disconnects a given player -func playerDisconnect(s *sdk.SDK, id string) { - log.Printf("Disconnecting Player: %s", id) - if _, err := s.Alpha().PlayerDisconnect(id); err != nil { - log.Fatalf("could not disconnect player: %v", err) - } -} - -// playerIsConnected returns a bool as a string if a player is connected -func playerIsConnected(s *sdk.SDK, id string) string { - log.Printf("Checking if player %s is connected", id) - - connected, err := s.Alpha().IsPlayerConnected(id) - if err != nil { - log.Fatalf("could not retrieve if player is connected: %v", err) - } - - return strconv.FormatBool(connected) + "\n" -} - -// getConnectedPlayers returns a comma delimeted list of connected players -func getConnectedPlayers(s *sdk.SDK) string { - log.Print("Retrieving connected player list") - list, err := s.Alpha().GetConnectedPlayers() - if err != nil { - log.Fatalf("could not retrieve connected players: %s", err) - } - - return strings.Join(list, ",") + "\n" -} - -// getPlayerCount returns the count of connected players as a string -func getPlayerCount(s *sdk.SDK) string { - log.Print("Retrieving connected player count") - count, err := s.Alpha().GetPlayerCount() - if err != nil { - log.Fatalf("could not retrieve player count: %s", err) - } - return strconv.FormatInt(count, 10) + "\n" -} - -// doHealth sends the regular Health Pings -func doHealth(sdk *sdk.SDK, stop <-chan struct{}) { - tick := time.Tick(2 * time.Second) - for { - err := sdk.Health() - if err != nil { - log.Fatalf("Could not send health ping, %v", err) - } - select { - case <-stop: - log.Print("Stopped health pings") - return - case <-tick: - } - } -} diff --git a/examples/webhookfleetautoscaler.yaml b/examples/webhookfleetautoscaler.yaml index 3ef3d65f0d..9a086f3131 100644 --- a/examples/webhookfleetautoscaler.yaml +++ b/examples/webhookfleetautoscaler.yaml @@ -26,7 +26,7 @@ kind: FleetAutoscaler metadata: name: webhook-fleet-autoscaler spec: - fleetName: simple-udp + fleetName: simple-game-server policy: # type of the policy - this example is Webhook type: Webhook diff --git a/examples/webhookfleetautoscalertls.yaml b/examples/webhookfleetautoscalertls.yaml index ccaadf7079..b0fcac6ff7 100644 --- a/examples/webhookfleetautoscalertls.yaml +++ b/examples/webhookfleetautoscalertls.yaml @@ -26,7 +26,7 @@ kind: FleetAutoscaler metadata: name: webhook-fleetautoscaler-tls spec: - fleetName: simple-udp + fleetName: simple-game-server policy: # type of the policy - this example is Webhook type: Webhook diff --git a/install/helm/agones/templates/tests/test-runner.yaml b/install/helm/agones/templates/tests/test-runner.yaml index 68f874f6f0..2a683d36ed 100644 --- a/install/helm/agones/templates/tests/test-runner.yaml +++ b/install/helm/agones/templates/tests/test-runner.yaml @@ -29,7 +29,7 @@ spec: imagePullPolicy: Always env: - name: GAMESERVER_IMAGE - value: "gcr.io/agones-images/udp-server:0.21" + value: "gcr.io/agones-images/simple-game-server:0.1" - name: IS_HELM_TEST value: "true" - name: GAMESERVERS_NAMESPACE diff --git a/pkg/util/webhooks/webhooks_test.go b/pkg/util/webhooks/webhooks_test.go index 8325d9f0f2..14f459e9fd 100644 --- a/pkg/util/webhooks/webhooks_test.go +++ b/pkg/util/webhooks/webhooks_test.go @@ -163,7 +163,7 @@ func TestWebHookFleetValidationHandler(t *testing.T) { "template": { "spec": { "containers": [{ - "image": "gcr.io/agones-images/udp-server:0.21", + "image": "gcr.io/agones-images/simple-game-server:0.1", "name": false }] } diff --git a/site/config.toml b/site/config.toml index 892df2ddee..63000f68d8 100644 --- a/site/config.toml +++ b/site/config.toml @@ -96,7 +96,7 @@ dev_aks_minor_supported_k8s = "13" dev_minikube_minor_supported_k8s = "13" # example tag -example_image_tag = "gcr.io/agones-images/udp-server:0.21" +example_image_tag = "gcr.io/agones-images/simple-game-server:0.1" # User interface configuration [params.ui] diff --git a/site/content/en/docs/Advanced/limiting-resources.md b/site/content/en/docs/Advanced/limiting-resources.md index 48019d0d5c..2321714263 100644 --- a/site/content/en/docs/Advanced/limiting-resources.md +++ b/site/content/en/docs/Advanced/limiting-resources.md @@ -29,7 +29,7 @@ we could do so as followed: apiVersion: "agones.dev/v1" kind: GameServer metadata: - name: "simple-udp" + name: "simple-game-server" spec: ports: - name: default @@ -37,7 +37,7 @@ spec: template: spec: containers: - - name: simple-udp + - name: simple-game-server image: {{% example-image %}} resources: limit: diff --git a/site/content/en/docs/Advanced/scheduling-and-autoscaling.md b/site/content/en/docs/Advanced/scheduling-and-autoscaling.md index dfa8e71b42..3072304605 100644 --- a/site/content/en/docs/Advanced/scheduling-and-autoscaling.md +++ b/site/content/en/docs/Advanced/scheduling-and-autoscaling.md @@ -73,7 +73,7 @@ There are two scheduling strategies for Fleets - each designed for different typ apiVersion: "agones.dev/v1" kind: Fleet metadata: - name: simple-udp + name: simple-game-server spec: replicas: 100 scheduling: Packed @@ -84,7 +84,7 @@ spec: template: spec: containers: - - name: simple-udp + - name: simple-game-server image: {{% example-image %}} ``` @@ -130,7 +130,7 @@ With the "Packed" strategy, Fleets will remove `Ready` `GameServers` from Nodes apiVersion: "agones.dev/v1" kind: Fleet metadata: - name: simple-udp + name: simple-game-server spec: replicas: 100 scheduling: Distributed @@ -141,7 +141,7 @@ spec: template: spec: containers: - - name: simple-udp + - name: simple-game-server image: {{% example-image %}} ``` diff --git a/site/content/en/docs/Advanced/service-accounts.md b/site/content/en/docs/Advanced/service-accounts.md index f94a10639b..905d273dfa 100644 --- a/site/content/en/docs/Advanced/service-accounts.md +++ b/site/content/en/docs/Advanced/service-accounts.md @@ -29,7 +29,7 @@ For example: apiVersion: "agones.dev/v1" kind: GameServer metadata: - generateName: "simple-udp-" + generateName: "simple-game-server-" spec: ports: - name: default @@ -38,7 +38,7 @@ spec: spec: serviceAccountName: my-special-service-account # a custom service account containers: - - name: simple-udp + - name: simple-game-server image: {{% example-image %}} ``` diff --git a/site/content/en/docs/Examples/_index.md b/site/content/en/docs/Examples/_index.md index bc968d3a80..b8ef1d8746 100644 --- a/site/content/en/docs/Examples/_index.md +++ b/site/content/en/docs/Examples/_index.md @@ -21,18 +21,25 @@ These are full examples for each of the resource types of Agones These are all examples of simple game server implementations, that integrate the Agones game server SDK. -- {{< ghlink href="examples/simple-udp" >}}Simple UDP{{< /ghlink >}} (Go) - simple server and client that send UDP packets back and forth. -- {{< ghlink href="examples/simple-tcp" >}}Simple TCP{{< /ghlink >}} (Go) - simple server that responds to new-line delimited messages sent over a TCP connection. -- {{< ghlink href="examples/simple-game-server" >}}Simple gameserver{{< /ghlink >}} (Go) - simple server that responds to TCP connections or UDP packets on the same port. -- {{< ghlink href="examples/cpp-simple" >}}CPP Simple{{< /ghlink >}} (C++) - C++ example that starts up, stays healthy and then shuts down after 60 seconds. -- {{< ghlink href="examples/nodejs-simple" >}}Node.js Simple{{< /ghlink >}} (Node.js) - +{{% feature expiryVersion="1.13.0" %}} +* ‌ {{% ghlink href="examples/simple-udp" %}}Simple UDP{{% /ghlink %}} (Go) - simple server and client that send + UDP packets back and forth. +* ‌ {{% ghlink href="examples/simple-tcp" %}}Simple TCP{{% /ghlink %}} (Go) - simple server that responds to + new-line delimited messages sent over a TCP connection. +{{% /feature %}} +* {{< ghlink href="examples/simple-game-server" >}}Simple gameserver{{< /ghlink >}} (Go) - simple server that + responds to TCP connections or UDP packets on the same port. +* {{< ghlink href="examples/cpp-simple" >}}CPP Simple{{< /ghlink >}} (C++) - C++ example that starts up, stays + healthy and then shuts down after 60 seconds. +* {{< ghlink href="examples/nodejs-simple" >}}Node.js Simple{{< /ghlink >}} (Node.js) - A simple Node.js example that marks itself as ready, sets some labels and then shutsdown. -- {{< ghlink href="examples/rust-simple" >}}Rust Simple{{< /ghlink >}} (Rust) - +* {{< ghlink href="examples/rust-simple" >}}Rust Simple{{< /ghlink >}} (Rust) - A simple Rust example that marks itself as ready, sets some labels and then shutsdown. -- {{< ghlink href="examples/unity-simple" >}}Unity Simple{{< /ghlink >}} (Unity3d) - +* {{< ghlink href="examples/unity-simple" >}}Unity Simple{{< /ghlink >}} (Unity3d) - This is a very simple "unity server" that doesn't do much other than show how the SDK works in Unity. -- {{< ghlink href="examples/xonotic" >}}Xonotic{{< /ghlink >}} - Wraps the SDK around the open source FPS game [Xonotic](http://www.xonotic.org) and hosts it on Agones. -- {{< ghlink href="examples/supertuxkart" >}}SuperTuxKart{{< /ghlink >}} \- Wraps the SDK around the open source +* {{< ghlink href="examples/xonotic" >}}Xonotic{{< /ghlink >}} - Wraps the SDK around the open source FPS game + [Xonotic](http://www.xonotic.org) and hosts it on Agones. +* {{< ghlink href="examples/supertuxkart" >}}SuperTuxKart{{< /ghlink >}} \- Wraps the SDK around the open source racing game [SuperTuxKart](https://supertuxkart.net/), and hosts it on Agones. ## Building on top of Agones diff --git a/site/content/en/docs/Getting Started/create-fleet.md b/site/content/en/docs/Getting Started/create-fleet.md index 751e6382ba..5ddc8fbef5 100644 --- a/site/content/en/docs/Getting Started/create-fleet.md +++ b/site/content/en/docs/Getting Started/create-fleet.md @@ -18,7 +18,7 @@ The following prerequisites are required to create a GameServer: If you don't have a Kubernetes cluster you can follow [these instructions]({{< ref "/docs/Installation/_index.md" >}}) to create a cluster on Google Kubernetes Engine (GKE), Minikube or Azure Kubernetes Service (AKS), and install Agones. -For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-udp/" >}}simple-udp{{< /ghlink >}} example as the GameServer container. This example is a very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information. +For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-game-server/" >}}simple-game-server{{< /ghlink >}} example as the GameServer container. This example is a very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information. While not required, you may wish to go through the [Create a Game Server]({{< relref "create-gameserver.md" >}}) quickstart before this one. @@ -35,13 +35,13 @@ While not required, you may wish to go through the [Create a Game Server]({{< re Let's create a Fleet using the following command : ``` -kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/fleet.yaml +kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/fleet.yaml ``` You should see a successful output similar to this : ``` -fleet "simple-udp" created +fleet.agones.dev/simple-game-server created ``` This has created a Fleet record inside Kubernetes, which in turn creates two warm [GameServers]({{< ref "/docs/Reference/gameserver.md" >}}) @@ -53,17 +53,17 @@ kubectl get fleet It should look something like this: ``` -NAME SCHEDULING DESIRED CURRENT ALLOCATED READY AGE -simple-udp Packed 2 3 0 2 9m +NAME SCHEDULING DESIRED CURRENT ALLOCATED READY AGE +simple-game-server Packed 2 3 0 2 9m ``` You can also see the GameServers that have been created by the Fleet by running `kubectl get gameservers`, -the GameServer will be prefixed by `simple-udp`. +the GameServer will be prefixed by `simple-game-server`. ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-llg4x-rx6rc Ready 192.168.122.205 7752 minikube 9m -simple-udp-llg4x-v6g2r Ready 192.168.122.205 7623 minikube 9m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-llg4x-rx6rc Ready 192.168.122.205 7752 minikube 9m +simple-game-server-llg4x-v6g2r Ready 192.168.122.205 7623 minikube 9m ``` For the full details of the YAML file head to the [Fleet Specification Guide]({{< ref "/docs/Reference/fleet.md" >}}) @@ -73,14 +73,14 @@ For the full details of the YAML file head to the [Fleet Specification Guide]({{ Let's wait for the two `GameServers` to become ready. ``` -watch kubectl describe fleet simple-udp +watch kubectl describe fleet simple-game-server ``` ``` -Name: simple-udp +Name: simple-game-server Namespace: default Labels: -Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"agones.dev/v1","kind":"Fleet","metadata":{"annotations":{},"name":"simple-udp","namespace":"default"},"spec":{"replicas":2,... +Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"agones.dev/v1","kind":"Fleet","metadata":{"annotations":{},"name":"simple-game-server","namespace":"default"},"spec":{"replicas":2,... API Version: agones.dev/v1 Kind: Fleet Metadata: @@ -88,7 +88,7 @@ Metadata: Creation Timestamp: 2018-07-01T18:55:35Z Generation: 1 Resource Version: 24685 - Self Link: /apis/agones.dev/v1/namespaces/default/fleets/simple-udp + Self Link: /apis/agones.dev/v1/namespaces/default/fleets/simple-game-server UID: 56710a91-7d60-11e8-b2dd-08002703ef08 Spec: Replicas: 2 @@ -112,7 +112,7 @@ Spec: Spec: Containers: Image: {{< example-image >}} - Name: simple-udp + Name: simple-game-server Resources: Status: Allocated Replicas: 0 @@ -121,7 +121,7 @@ Status: Events: Type Reason Age From Message ---- ------ ---- ---- ------- - Normal CreatingGameServerSet 13s fleet-controller Created GameServerSet simple-udp-wlqnd + Normal CreatingGameServerSet 13s fleet-controller Created GameServerSet simple-game-server-wlqnd ``` If you look towards the bottom, you can see there is a section of `Status > Ready Replicas` which will tell you @@ -131,17 +131,17 @@ how many `GameServers` are currently in a Ready state. After a short period, the Let's scale up the `Fleet` from 2 `replicates` to 5. -Run `kubectl scale fleet simple-udp --replicas=5` to change Replicas count from 2 to 5. +Run `kubectl scale fleet simple-game-server --replicas=5` to change Replicas count from 2 to 5. -If we now run `kubectl get gameservers` we should see 5 `GameServers` prefixed by `simple-udp`. +If we now run `kubectl get gameservers` we should see 5 `GameServers` prefixed by `simple-game-server`. ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-sdhzn-kcmh6 Ready 192.168.122.205 7191 minikube 52m -simple-udp-sdhzn-pdpk5 Ready 192.168.122.205 7752 minikube 53m -simple-udp-sdhzn-r4d6x Ready 192.168.122.205 7623 minikube 52m -simple-udp-sdhzn-wng5k Ready 192.168.122.205 7709 minikube 53m -simple-udp-sdhzn-wnhsw Ready 192.168.122.205 7478 minikube 52m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-sdhzn-kcmh6 Ready 192.168.122.205 7191 minikube 52m +simple-game-server-sdhzn-pdpk5 Ready 192.168.122.205 7752 minikube 53m +simple-game-server-sdhzn-r4d6x Ready 192.168.122.205 7623 minikube 52m +simple-game-server-sdhzn-wng5k Ready 192.168.122.205 7709 minikube 53m +simple-game-server-sdhzn-wnhsw Ready 192.168.122.205 7478 minikube 52m ``` ### 4. Allocate a Game Server from the Fleet @@ -163,10 +163,10 @@ A `GameServerAllocation` uses a [label selector](https://kubernetes.io/docs/conc to determine what group of `GameServers` it will attempt to allocate out of. That being said, a `Fleet` and `GameServerAllocation` are often used in conjunction. -{{< ghlink href="/examples/simple-udp/gameserverallocation.yaml" >}}This example{{< /ghlink >}} uses the label selector to specifically target the `simple-udp` fleet that we just created. +{{< ghlink href="/examples/simple-game-server/gameserverallocation.yaml" >}}This example{{< /ghlink >}} uses the label selector to specifically target the `simple-game-server` fleet that we just created. ``` -kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserverallocation.yaml -o yaml +kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserverallocation.yaml -o yaml ``` For the full details of the YAML file head to the [GameServerAllocation Specification Guide]({{< ref "/docs/Reference/gameserverallocation.md" >}}) @@ -178,17 +178,17 @@ apiVersion: allocation.agones.dev/v1 kind: GameServerAllocation metadata: creationTimestamp: 2019-02-19T02:13:12Z - name: simple-udp-dph9b-hfk24 + name: simple-game-server-dph9b-hfk24 namespace: default spec: metadata: {} required: matchLabels: - agones.dev/fleet: simple-udp + agones.dev/fleet: simple-game-server scheduling: Packed status: address: 192.168.122.152 - gameServerName: simple-udp-dph9b-hfk24 + gameServerName: simple-game-server-dph9b-hfk24 nodeName: minikube ports: - name: default @@ -217,12 +217,12 @@ kubectl get gs This will get you a list of all the current `GameServers` and their `Status.State`. ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-sdhzn-kcmh6 Ready 192.168.122.205 7191 minikube 52m -simple-udp-sdhzn-pdpk5 Ready 192.168.122.205 7752 minikube 53m -simple-udp-sdhzn-r4d6x Allocated 192.168.122.205 7623 minikube 52m -simple-udp-sdhzn-wng5k Ready 192.168.122.205 7709 minikube 53m -simple-udp-sdhzn-wnhsw Ready 192.168.122.205 7478 minikube 52m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-sdhzn-kcmh6 Ready 192.168.122.205 7191 minikube 52m +simple-game-server-sdhzn-pdpk5 Ready 192.168.122.205 7752 minikube 53m +simple-game-server-sdhzn-r4d6x Allocated 192.168.122.205 7623 minikube 52m +simple-game-server-sdhzn-wng5k Ready 192.168.122.205 7709 minikube 53m +simple-game-server-sdhzn-wnhsw Ready 192.168.122.205 7478 minikube 52m ``` {{< alert title="Note" color="info">}} @@ -239,12 +239,12 @@ kubectl get gs This will get you a list of all the current `GameServers` and their `Status > State`. ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-tfqn7-c9tqz Ready 192.168.39.150 7136 minikube 52m -simple-udp-tfqn7-g8fhq Allocated 192.168.39.150 7148 minikube 53m -simple-udp-tfqn7-p8wnl Ready 192.168.39.150 7453 minikube 52m -simple-udp-tfqn7-t6bwp Ready 192.168.39.150 7228 minikube 53m -simple-udp-tfqn7-wkb7b Ready 192.168.39.150 7226 minikube 52m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-tfqn7-c9tqz Ready 192.168.39.150 7136 minikube 52m +simple-game-server-tfqn7-g8fhq Allocated 192.168.39.150 7148 minikube 53m +simple-game-server-tfqn7-p8wnl Ready 192.168.39.150 7453 minikube 52m +simple-game-server-tfqn7-t6bwp Ready 192.168.39.150 7228 minikube 53m +simple-game-server-tfqn7-wkb7b Ready 192.168.39.150 7226 minikube 52m ``` ### 5. Scale down the Fleet @@ -257,7 +257,7 @@ and we shouldn't disconnect them! Let's scale down our Fleet to 0 (yep! you can do that!), and watch what happens. -Run `kubectl scale fleet simple-udp --replicas=0` to change Replicas count from 5 to 0. +Run `kubectl scale fleet simple-game-server --replicas=0` to change Replicas count from 5 to 0. It may take a moment for all the `GameServers` to shut down, so let's watch them all and see what happens: ``` @@ -267,8 +267,8 @@ watch kubectl get gs Eventually, one by one they will be removed from the list, and you should simply see: ``` -NAME STATUS ADDRESS PORT NODE AGE -simple-udp-tfqn7-g8fhq Allocated 192.168.39.150 7148 minikube 55m +NAME STATUS ADDRESS PORT NODE AGE +simple-game-server-tfqn7-g8fhq Allocated 192.168.39.150 7148 minikube 55m ``` That lone `Allocated` `GameServer` is left all alone, but still running! @@ -309,12 +309,12 @@ of `GameServers` in the pool in either a `Ready` or `Allocated` state. We can also change the configuration of the `GameServer` of the running `Fleet`, and have the changes roll out, without interrupting the currently `Allocated` `GameServers`. -Let's take this for a spin! Run `kubectl scale fleet simple-udp --replicas=5` to return Replicas count back to 5. +Let's take this for a spin! Run `kubectl scale fleet simple-game-server --replicas=5` to return Replicas count back to 5. Let's also allocate ourselves a `GameServer` ``` -kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserverallocation.yaml -o yaml +kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserverallocation.yaml -o yaml ``` We should now have four `Ready` `GameServers` and one `Allocated`. @@ -322,25 +322,25 @@ We should now have four `Ready` `GameServers` and one `Allocated`. We can check this by running `kubectl get gs`. ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-tfqn7-c9tz7 Ready 192.168.39.150 7136 minikube 5m -simple-udp-tfqn7-g8fhq Allocated 192.168.39.150 7148 minikube 5m -simple-udp-tfqn7-n0wnl Ready 192.168.39.150 7453 minikube 5m -simple-udp-tfqn7-hiiwp Ready 192.168.39.150 7228 minikube 5m -simple-udp-tfqn7-w8z7b Ready 192.168.39.150 7226 minikube 5m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-tfqn7-c9tz7 Ready 192.168.39.150 7136 minikube 5m +simple-game-server-tfqn7-g8fhq Allocated 192.168.39.150 7148 minikube 5m +simple-game-server-tfqn7-n0wnl Ready 192.168.39.150 7453 minikube 5m +simple-game-server-tfqn7-hiiwp Ready 192.168.39.150 7228 minikube 5m +simple-game-server-tfqn7-w8z7b Ready 192.168.39.150 7226 minikube 5m ``` In production, we'd likely be changing a `containers > image` configuration to update our `Fleet` to run a new game server process, but to make this example simple, change `containerPort` from `7654` to `6000`. -Run `kubectl edit fleet simple-udp`, and make the necessary changes, and then save and exit your editor. +Run `kubectl edit fleet simple-game-server`, and make the necessary changes, and then save and exit your editor. This will start the deployment of a new set of `GameServers` running with a Container Port of `6000`. {{< alert title="Warning" color="warning">}} -This will make it such that you can no longer connect to the simple-udp game server. +This will make it such that you can no longer connect to the simple-game-server game server. {{< /alert >}} Run `watch kubectl get gs` diff --git a/site/content/en/docs/Getting Started/create-fleetautoscaler.md b/site/content/en/docs/Getting Started/create-fleetautoscaler.md index 668acae596..ee17d72a53 100644 --- a/site/content/en/docs/Getting Started/create-fleetautoscaler.md +++ b/site/content/en/docs/Getting Started/create-fleetautoscaler.md @@ -25,13 +25,13 @@ and you have a running fleet of game servers. Let's create a Fleet Autoscaler using the following command : ``` -kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/fleetautoscaler.yaml +kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/fleetautoscaler.yaml ``` You should see a successful output similar to this : ``` -fleetautoscaler.autoscaling.agones.dev "simple-udp-autoscaler" created +fleetautoscaler.autoscaling.agones.dev/simple-game-server-autoscaler created ``` This has created a FleetAutoscaler record inside Kubernetes. @@ -39,18 +39,18 @@ This has created a FleetAutoscaler record inside Kubernetes. ### 2. See the autoscaler status. ``` -kubectl describe fleetautoscaler simple-udp-autoscaler +kubectl describe fleetautoscaler simple-game-server-autoscaler ``` It should look something like this: ``` -Name: simple-udp-autoscaler +Name: simple-game-server-autoscaler Namespace: default Labels: Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"au toscaling.agones.dev/v1","kind":"FleetAutoscaler","metadata":{"annotations":{}, -"name":"simple-udp-autoscaler","namespace":"default"},... +"name":"simple-game-server-autoscaler","namespace":"default"},... API Version: autoscaling.agones.dev/v1 Kind: FleetAutoscaler Metadata: @@ -62,14 +62,13 @@ Metadata: Block Owner Deletion: true Controller: true Kind: Fleet - Name: simple-udp + Name: simple-game-server UID: 9960762e-c656-11e8-933e-fa163e07a1d4 Resource Version: 6123197 - Self Link: /apis/autoscaling.agones.dev/v1/namespaces/default/f -leetautoscalers/simple-udp-autoscaler + Self Link: /apis/autoscaling.agones.dev/v1/namespaces/default/fleetautoscalers/simple-game-server-autoscaler UID: 9fd0efa1-c656-11e8-933e-fa163e07a1d4 Spec: - Fleet Name: simple-udp + Fleet Name: simple-game-server Policy: Buffer: Buffer Size: 2 @@ -97,14 +96,14 @@ If you're interested in more details for game server allocation, you should cons In here we are only interested in triggering allocations to see the autoscaler in action. ``` -kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserverallocation.yaml -o yaml +kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserverallocation.yaml -o yaml ``` You should get in return the allocated game server details, which should end with something like: ``` status: address: 34.94.118.237 - gameServerName: simple-udp-v6jwb-6bzkz + gameServerName: simple-game-server-v6jwb-6bzkz nodeName: gke-test-cluster-default-f11755a7-5km3 ports: - name: default @@ -119,14 +118,14 @@ Note the address and port, you might need them later to connect to the server. Now let's wait a few seconds to allow the autoscaler to detect the change in the fleet and check again its status ``` -kubectl describe fleetautoscaler simple-udp-autoscaler +kubectl describe fleetautoscaler simple-game-server-autoscaler ``` The last part should look something like this: ``` Spec: - Fleet Name: simple-udp + Fleet Name: simple-game-server Policy: Buffer: Buffer Size: 2 @@ -142,7 +141,7 @@ Status: Events: Type Reason Age From Message ---- ------ ---- ---- ------- - Normal AutoScalingFleet 2m fleetautoscaler-controller Scaling fleet simple-udp from 2 to 3 + Normal AutoScalingFleet 2m fleetautoscaler-controller Scaling fleet simple-game-server from 2 to 3 ``` You can see that the fleet size has increased, the autoscaler having compensated for the allocated instance. @@ -157,10 +156,10 @@ kubectl get gs This will get you a list of all the current `GameServers` and their `Status > State`. ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-mzhrl-hz8wk Allocated 10.30.64.99 7131 minikube 5m -simple-udp-mzhrl-k6jg5 Ready 10.30.64.100 7243 minikube 5m -simple-udp-mzhrl-n2sk2 Ready 10.30.64.168 7658 minikube 5m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-mzhrl-hz8wk Allocated 10.30.64.99 7131 minikube 5m +simple-game-server-mzhrl-k6jg5 Ready 10.30.64.100 7243 minikube 5m +simple-game-server-mzhrl-n2sk2 Ready 10.30.64.168 7658 minikube 5m ``` ### 5. Shut the allocated instance down @@ -190,14 +189,14 @@ You can finally type `EXIT` which tells the SDK to run the [Shutdown command]({{ Now let's wait a few seconds to allow the autoscaler to detect the change in the fleet and check again its status ``` -kubectl describe fleetautoscaler simple-udp-autoscaler +kubectl describe fleetautoscaler simple-game-server-autoscaler ``` It should look something like this: ``` Spec: - Fleet Name: simple-udp + Fleet Name: simple-game-server Policy: Buffer: Buffer Size: 2 @@ -213,12 +212,12 @@ Status: Events: Type Reason Age From Message ---- ------ ---- ---- ------- - Normal AutoScalingFleet 9m fleetautoscaler-controller Scaling fleet simple-udp from 2 to 3 - Normal AutoScalingFleet 45s fleetautoscaler-controller Scaling fleet simple-udp from 3 to 2 + Normal AutoScalingFleet 9m fleetautoscaler-controller Scaling fleet simple-game-server from 2 to 3 + Normal AutoScalingFleet 45s fleetautoscaler-controller Scaling fleet simple-game-server from 3 to 2 ``` You can see that the fleet size has decreased, the autoscaler adjusting to game server instance being de-allocated, -the Last Scale Time and the events have been updated. Note that simple-udp game server instance you just closed earlier +the Last Scale Time and the events have been updated. Note that simple-game-server game server instance you just closed earlier might stay a bit in 'Unhealthy' state (and its pod in 'Terminating' until it gets removed. Double-check the actual number of game server instances and status by running @@ -230,9 +229,9 @@ kubectl get gs This will get you a list of all the current `GameServers` and their `Status > State`. ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-mzhrl-k6jg5 Ready 10.30.64.100 7243 minikube 5m -simple-udp-mzhrl-t7944 Ready 10.30.64.168 7561 minikube 5m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-mzhrl-k6jg5 Ready 10.30.64.100 7243 minikube 5m +simple-game-server-mzhrl-t7944 Ready 10.30.64.168 7561 minikube 5m ``` ### 7. Change autoscaling parameters @@ -240,19 +239,19 @@ simple-udp-mzhrl-t7944 Ready 10.30.64.168 7561 minikube 5m We can also change the configuration of the `FleetAutoscaler` of the running `Fleet`, and have the changes applied live, without interruptions of service. -Run `kubectl edit fleetautoscaler simple-udp-autoscaler` and set the `bufferSize` field to `5`. +Run `kubectl edit fleetautoscaler simple-game-server-autoscaler` and set the `bufferSize` field to `5`. ] Let's look at the list of game servers again. Run `watch kubectl get gs` until you can see that are 5 ready server instances: ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-mzhrl-7jpkp Ready 10.30.64.100 7019 minikube 5m -simple-udp-mzhrl-czt8v Ready 10.30.64.168 7556 minikube 5m -simple-udp-mzhrl-k6jg5 Ready 10.30.64.100 7243 minikube 5m -simple-udp-mzhrl-nb8h2 Ready 10.30.64.168 7357 minikube 5m -simple-udp-mzhrl-qspb6 Ready 10.30.64.99 7859 minikube 5m -simple-udp-mzhrl-zg9rq Ready 10.30.64.99 7745 minikube 5m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-mzhrl-7jpkp Ready 10.30.64.100 7019 minikube 5m +simple-game-server-mzhrl-czt8v Ready 10.30.64.168 7556 minikube 5m +simple-game-server-mzhrl-k6jg5 Ready 10.30.64.100 7243 minikube 5m +simple-game-server-mzhrl-nb8h2 Ready 10.30.64.168 7357 minikube 5m +simple-game-server-mzhrl-qspb6 Ready 10.30.64.99 7859 minikube 5m +simple-game-server-mzhrl-zg9rq Ready 10.30.64.99 7745 minikube 5m ``` {{< alert title="Note" color="info">}} diff --git a/site/content/en/docs/Getting Started/create-gameserver.md b/site/content/en/docs/Getting Started/create-gameserver.md index edf27ff9dc..ff718a4bbe 100644 --- a/site/content/en/docs/Getting Started/create-gameserver.md +++ b/site/content/en/docs/Getting Started/create-gameserver.md @@ -24,20 +24,20 @@ The following prerequisites are required to create a GameServer : If you don't have a Kubernetes cluster you can follow [these instructions]({{< ref "/docs/Installation/_index.md" >}}) to create a cluster on Google Kubernetes Engine (GKE), Minikube or Azure Kubernetes Service (AKS), and install Agones. -For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-udp/" >}}simple-udp{{< /ghlink >}} example as the GameServer container. This example is a very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information. +For the purpose of this guide we're going to use the {{< ghlink href="examples/simple-game-server/" >}}simple-game-server{{< /ghlink >}} example as the GameServer container. This example is a very simple UDP server written in Go. Don't hesitate to look at the code of this example for more information. ### 1. Create a GameServer Let's create a GameServer using the following command : ``` -kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserver.yaml +kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserver.yaml ``` You should see a successful output similar to this : ``` -gameserver "simple-udp" created +gameserver.agones.dev/simple-game-server-4ss4j created ``` This has created a GameServer record inside Kubernetes, which has also created a backing [Pod](https://kubernetes.io/docs/concepts/workloads/pods/pod/) to run our simple udp game server code in. @@ -49,15 +49,15 @@ kubectl get gameservers It should look something like this: ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-7pjrq Ready 35.233.183.43 7190 agones 3m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-7pjrq Ready 35.233.183.43 7190 agones 3m ``` -You can also see the [Pod](https://kubernetes.io/docs/concepts/workloads/pods/pod/) that got created by running `kubectl get pods`, the Pod will be prefixed by `simple-udp`. +You can also see the [Pod](https://kubernetes.io/docs/concepts/workloads/pods/pod/) that got created by running `kubectl get pods`, the Pod will be prefixed by `simple-game-server`. ``` -NAME READY STATUS RESTARTS AGE -simple-udp-7pjrq 2/2 Running 0 5m +NAME READY STATUS RESTARTS AGE +simple-game-server-7pjrq 2/2 Running 0 5m ``` As you can see above it says `READY: 2/2` this means there are two containers running in this Pod, this is because Agones injected the SDK sidecar for readiness and health checking of your Game Server. @@ -74,7 +74,7 @@ watch kubectl describe gameserver ``` ``` -Name: simple-udp-7pjrq +Name: simple-game-server-7pjrq Namespace: default Labels: Annotations: agones.dev/sdk-version: 0.9.0-764fa53 @@ -84,13 +84,13 @@ Metadata: Creation Timestamp: 2019-02-27T15:06:20Z Finalizers: agones.dev - Generate Name: simple-udp- + Generate Name: simple-game-server- Generation: 1 Resource Version: 30377 - Self Link: /apis/agones.dev/v1/namespaces/default/gameservers/simple-udp-7pjrq + Self Link: /apis/agones.dev/v1/namespaces/default/gameservers/simple-game-server-7pjrq UID: 3d7ac3e1-3aa1-11e9-a4f5-42010a8a0019 Spec: - Container: simple-udp + Container: simple-game-server Health: Failure Threshold: 3 Initial Delay Seconds: 5 @@ -108,7 +108,7 @@ Spec: Spec: Containers: Image: {{< example-image >}} - Name: simple-udp + Name: simple-game-server Resources: Limits: Cpu: 20m @@ -127,7 +127,7 @@ Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal PortAllocation 34s gameserver-controller Port allocated - Normal Creating 34s gameserver-controller Pod simple-udp-7pjrq created + Normal Creating 34s gameserver-controller Pod simple-game-server-7pjrq created Normal Scheduled 34s gameserver-controller Address and port populated Normal Ready 27s gameserver-controller SDK.Ready() executed ``` @@ -146,8 +146,8 @@ kubectl get gs This should output your Game Server IP address and ports, eg: ``` -NAME STATE ADDRESS PORT NODE AGE -simple-udp-7pjrq Ready 35.233.183.43 7190 agones 4m +NAME STATE ADDRESS PORT NODE AGE +simple-game-server-7pjrq Ready 35.233.183.43 7190 agones 4m ``` {{< alert title="Note" color="info">}} diff --git a/site/content/en/docs/Getting Started/create-webhook-fleetautoscaler.md b/site/content/en/docs/Getting Started/create-webhook-fleetautoscaler.md index f085823f13..a23cd5e456 100644 --- a/site/content/en/docs/Getting Started/create-webhook-fleetautoscaler.md +++ b/site/content/en/docs/Getting Started/create-webhook-fleetautoscaler.md @@ -34,7 +34,7 @@ It is assumed that you have completed the instructions to [Create a Game Server Run a fleet in a cluster: ``` -kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/fleet.yaml +kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/fleet.yaml ``` #### 2. Deploy a Webhook service for autoscaling @@ -117,7 +117,7 @@ etadata: autoscalers/webhook-fleet-autoscaler UID: 6d03eae4-05e8-11e9-84c2-42010a8a01c9 Spec: - Fleet Name: simple-udp + Fleet Name: simple-game-server Policy: Type: Webhook Webhook: @@ -146,7 +146,7 @@ If you're interested in more details for game server allocation, you should cons Here we only interested in triggering allocations to see the autoscaler in action. ``` -kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserverallocation.yaml -o yaml +kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserverallocation.yaml -o yaml ``` You should get in return the allocated game server details, which should end with something like: @@ -154,7 +154,7 @@ You should get in return the allocated game server details, which should end wit ``` status: address: 34.94.118.237 - gameServerName: simple-udp-v6jwb-6bzkz + gameServerName: simple-game-server-v6jwb-6bzkz nodeName: gke-test-cluster-default-f11755a7-5km3 ports: - name: default @@ -166,7 +166,7 @@ Note the address and port, you might need them later to connect to the server. Run the kubectl command one more time so that we have both servers allocated: ``` -kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserverallocation.yaml -o yaml +kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserverallocation.yaml -o yaml ``` #### 6. Check new Autoscaler and Fleet status @@ -181,7 +181,7 @@ The last part should look similar to this: ``` Spec: - Fleet Name: simple-udp + Fleet Name: simple-game-server Policy: Type: Webhook Webhook: @@ -199,7 +199,7 @@ Status: Events: Type Reason Age From Message ---- ------ ---- ---- ------- - Normal AutoScalingFleet 35s fleetautoscaler-controller Scaling fleet simple-udp from 2 to 4 + Normal AutoScalingFleet 35s fleetautoscaler-controller Scaling fleet simple-game-server from 2 to 4 ``` You can see that the fleet size has increased in particular case doubled to 4 gameservers (based on our custom logic in our webhook), the autoscaler having compensated for the two allocated instances. @@ -215,10 +215,10 @@ This will get you a list of all the current `GameServers` and their `Status > St ``` NAME STATE ADDRESS PORT NODE AGE -simple-udp-dmkp4-8pkk2 Ready 35.247.13.175 7386 minikube 5m -simple-udp-dmkp4-b7x87 Allocated 35.247.13.175 7219 minikube 5m -simple-udp-dmkp4-r4qtt Allocated 35.247.13.175 7220 minikube 5m -simple-udp-dmkp4-rsr6n Ready 35.247.13.175 7297 minikube 5m +simple-game-server-dmkp4-8pkk2 Ready 35.247.13.175 7386 minikube 5m +simple-game-server-dmkp4-b7x87 Allocated 35.247.13.175 7219 minikube 5m +simple-game-server-dmkp4-r4qtt Allocated 35.247.13.175 7220 minikube 5m +simple-game-server-dmkp4-rsr6n Ready 35.247.13.175 7297 minikube 5m ``` #### 7. Check downscaling using Webhook Autoscaler policy @@ -242,8 +242,8 @@ kubectl describe fleetautoscaler webhook-fleet-autoscaler You should see these lines in events: ``` - Normal AutoScalingFleet 11m fleetautoscaler-controller Scaling fleet simple-udp from 2 to 4 - Normal AutoScalingFleet 1m fleetautoscaler-controller Scaling fleet simple-udp from 4 to 2 + Normal AutoScalingFleet 11m fleetautoscaler-controller Scaling fleet simple-game-server from 2 to 4 + Normal AutoScalingFleet 1m fleetautoscaler-controller Scaling fleet simple-game-server from 4 to 2 ``` And get gameservers command output: @@ -252,9 +252,9 @@ kubectl get gs -n default ``` ``` -NAME STATUS ADDRESS PORT NODE AGE -simple-udp-884fg-6q5sk Ready 35.247.117.202 7373 minikube 5m -simple-udp-884fg-b7l58 Allocated 35.247.117.202 7766 minikube 5m +NAME STATUS ADDRESS PORT NODE AGE +simple-game-server-884fg-6q5sk Ready 35.247.117.202 7373 minikube 5m +simple-game-server-884fg-b7l58 Allocated 35.247.117.202 7766 minikube 5m ``` #### 8. Cleanup @@ -267,7 +267,7 @@ kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/{{< re Removing the fleet: ``` -kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/fleet.yaml +kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/fleet.yaml ``` ## Chapter 2 Configuring HTTPS fleetautoscaler webhook with CA Bundle @@ -283,7 +283,7 @@ the possibility of a man-in-the-middle attack between the fleetautoscaler and th Run a fleet in a cluster: ``` -kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/fleet.yaml +kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/fleet.yaml ``` #### 2. Create X509 Root and Webhook certificates @@ -394,7 +394,7 @@ If you're interested in more details for game server allocation, you should cons Here we only interested in triggering allocations to see the autoscaler in action. ``` -for i in {0..1} ; do kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserverallocation.yaml -o yaml ; done +for i in {0..1} ; do kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserverallocation.yaml -o yaml ; done ``` #### 7. Check new Autoscaler and Fleet status @@ -408,7 +408,7 @@ kubectl describe fleetautoscaler webhook-fleetautoscaler-tls The last part should look similar to this: ```Spec: - Fleet Name: simple-udp + Fleet Name: simple-game-server Policy: Type: Webhook Webhook: @@ -418,7 +418,7 @@ The last part should look similar to this: Events: Type Reason Age From Message ---- ------ ---- ---- ------- - Normal AutoScalingFleet 5s fleetautoscaler-controller Scaling fleet simple-udp from 2 to 4 + Normal AutoScalingFleet 5s fleetautoscaler-controller Scaling fleet simple-game-server from 2 to 4 ``` You can see that the fleet size has increased in particular case doubled to 4 gameservers (based on our custom logic in our webhook), the autoscaler having compensated for the two allocated instances. @@ -434,8 +434,8 @@ This will get you a list of all the current `GameServers` and their `Status > St ``` NAME STATE ADDRESS PORT NODE AGE -simple-udp-njmr7-2t4nx Ready 35.203.159.68 7330 minikube 1m -simple-udp-njmr7-65rp6 Allocated 35.203.159.68 7294 minikube 4m +simple-game-server-njmr7-2t4nx Ready 35.203.159.68 7330 minikube 1m +simple-game-server-njmr7-65rp6 Allocated 35.203.159.68 7294 minikube 4m ``` #### 8. Cleanup @@ -452,7 +452,7 @@ kubectl delete secret autoscalersecret Removing the fleet: ``` -kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/fleet.yaml +kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/fleet.yaml ``` ### Comments diff --git a/site/content/en/docs/Getting Started/edit-first-gameserver-go.md b/site/content/en/docs/Getting Started/edit-first-gameserver-go.md index 89d96e7a6d..6d8cc2adef 100644 --- a/site/content/en/docs/Getting Started/edit-first-gameserver-go.md +++ b/site/content/en/docs/Getting Started/edit-first-gameserver-go.md @@ -3,7 +3,7 @@ title: "Quickstart: Edit a Game Server" linkTitle: "Edit Your First Game Server (Go)" date: 2019-01-02T06:42:56Z description: > - The following guide is for developers without Docker or Kubernetes experience, that want to use the simple-udp example as a starting point for a custom game server. + The following guide is for developers without Docker or Kubernetes experience, that want to use the simple-game-server example as a starting point for a custom game server. --- This guide addresses Google Kubernetes Engine and Minikube. We would welcome a Pull Request to expand this to include other platforms as well. @@ -24,8 +24,8 @@ Also complete the "Enabling creation of RBAC resources" and "Installing Agones" ## Modify the code and push another new image -### Modify the simple-udp example source code -Modify the {{< ghlink href="examples/simple-udp/main.go" >}}main.go{{< /ghlink >}} file. For example: +### Modify the simple-game-server example source code +Modify the {{< ghlink href="examples/simple-game-server/main.go" >}}main.go{{< /ghlink >}} file. For example: Change the following line in `main.go`: @@ -51,14 +51,14 @@ Since Docker image is using Alpine Linux, the "go build" command has to include ### Create a new docker image ```bash ->> docker build -t gcr.io/[PROJECT_ID]/agones-udp-server:modified . +>> docker build -t gcr.io/[PROJECT_ID]/agones-simple-game-server:modified . ``` -Note: you can change the image name "agones-udp-server" to something else. +Note: you can change the image name "agones-simple-game-server" to something else. ### If using GKE, push the image to GCP Registry ```bash ->> docker push gcr.io/[PROJECT_ID]/agones-udp-server:modified +>> docker push gcr.io/[PROJECT_ID]/agones-simple-game-server:modified ``` Note: Review [Authentication Methods](https://cloud.google.com/container-registry/docs/advanced-authentication) @@ -67,7 +67,7 @@ and advanced authentication methods to the Google Container Registry. ### If using Minikube, load the image into Minikube ```bash ->> docker save gcr.io/[PROJECT_ID]/agones-udp-server:modified | (eval $(minikube docker-env) && docker load) +>> minikube cache add gcr.io/[PROJECT_ID]/agones-agones-simple-game-server:modified ``` ### Modify gameserver.yaml @@ -76,8 +76,8 @@ Modify the following line from gameserver.yaml to use the new configuration. ```yaml spec: containers: - - name: agones-simple-udp - image: gcr.io/[PROJECT_ID]/agones-udp-server:modified + - name: agones-simple-game-server + image: gcr.io/[PROJECT_ID]/agones-simple-game-server:modified ``` ### If using GKE, deploy Server to GKE @@ -103,7 +103,7 @@ Apply the latest settings to the Kubernetes container. Let's retrieve the IP address and the allocated port of your Game Server: ``` -kubectl get gs simple-udp -o jsonpath='{.status.address}:{.status.ports[0].port}' +kubectl get gs simple-game-server -o jsonpath='{.status.address}:{.status.ports[0].port}' ``` You can now communicate with the Game Server : diff --git a/site/content/en/docs/Guides/Client SDKs/local.md b/site/content/en/docs/Guides/Client SDKs/local.md index 09182c6389..96eaf4e11f 100644 --- a/site/content/en/docs/Guides/Client SDKs/local.md +++ b/site/content/en/docs/Guides/Client SDKs/local.md @@ -63,7 +63,7 @@ happen when live as well. For example: ```console -$ wget https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-udp/gameserver.yaml +$ wget https://raw.githubusercontent.com/googleforgames/agones/{{< release-branch >}}/examples/simple-game-server/gameserver.yaml $ ./sdk-server.linux.amd64 --local -f ./gameserver.yaml {"ctlConf":{"Address":"localhost","IsLocal":true,"LocalFile":"./gameserver.yaml","Delay":0,"Timeout":0,"Test":"","GRPCPort":9357,"HTTPPort":9358},"message":"Starting sdk sidecar","severity":"info","source":"main","time":"2019-10-30T21:47:45.742776+03:00","version":"1.1.0"} {"filePath":"/Users/alexander.apalikov/Downloads/agonessdk-server-1.1.0/gameserver.yaml","message":"Reading GameServer configuration","severity":"info","time":"2019-10-30T21:47:45.743369+03:00"} diff --git a/site/content/en/docs/Guides/access-api.md b/site/content/en/docs/Guides/access-api.md index b10b237c14..a1f0033040 100644 --- a/site/content/en/docs/Guides/access-api.md +++ b/site/content/en/docs/Guides/access-api.md @@ -90,9 +90,9 @@ func main() { } // Create a GameServer - gs := &agonesv1.GameServer{ObjectMeta: metav1.ObjectMeta{GenerateName: "udp-server", Namespace: "default"}, + gs := &agonesv1.GameServer{ObjectMeta: metav1.ObjectMeta{GenerateName: "simple-game-server", Namespace: "default"}, Spec: agonesv1.GameServerSpec{ - Container: "udp-server", + Container: "simple-game-server", Ports: []agonesv1.GameServerPort{{ ContainerPort: 7654, HostPort: 7654, @@ -102,7 +102,7 @@ func main() { }}, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - Containers: []corev1.Container{{Name: "udp-server", Image: "{{% example-image %}}"}}, + Containers: []corev1.Container{{Name: "simple-game-server", Image: "{{% example-image %}}"}}, }, }, }, @@ -200,7 +200,7 @@ $ curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/gameservers "kind": "GameServer", "metadata": { "annotations": { - "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"agones.dev/v1\",\"kind\":\"GameServer\",\"metadata\":{\"annotations\":{},\"name\":\"simple-udp\",\"namespace\":\"default\"},\"spec\":{\"containerPort\":7654,\"hostPort\":7777,\"portPolicy\":\"static\",\"template\":{\"spec\":{\"containers\":[{\"image\":\"{{% example-image %}}\",\"name\":\"simple-udp\"}]}}}}\n" + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"agones.dev/v1\",\"kind\":\"GameServer\",\"metadata\":{\"annotations\":{},\"name\":\"simple-game-server\",\"namespace\":\"default\"},\"spec\":{\"containerPort\":7654,\"hostPort\":7777,\"portPolicy\":\"static\",\"template\":{\"spec\":{\"containers\":[{\"image\":\"{{% example-image %}}\",\"name\":\"simple-game-server\"}]}}}}\n" }, "clusterName": "", "creationTimestamp": "2018-03-02T21:41:05Z", @@ -208,15 +208,15 @@ $ curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/gameservers "agones.dev" ], "generation": 0, - "name": "simple-udp", + "name": "simple-game-server", "namespace": "default", "resourceVersion": "760", - "selfLink": "/apis/agones.dev/v1/namespaces/default/gameservers/simple-udp", + "selfLink": "/apis/agones.dev/v1/namespaces/default/gameservers/simple-game-server", "uid": "692beea6-1e62-11e8-beb2-080027637781" }, "spec": { "PortPolicy": "Static", - "container": "simple-udp", + "container": "simple-game-server", "containerPort": 7654, "health": { "failureThreshold": 3, @@ -233,7 +233,7 @@ $ curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/gameservers "containers": [ { "image": "{{% example-image %}}", - "name": "simple-udp", + "name": "simple-game-server", "resources": {} } ] @@ -256,15 +256,15 @@ $ curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/gameservers } } -# allocate a gameserver from a fleet named 'simple-udp', with GameServerAllocation +# allocate a gameserver from a fleet named 'simple-game-server', with GameServerAllocation -$ curl -d '{"apiVersion":"allocation.agones.dev/v1","kind":"GameServerAllocation","spec":{"required":{"matchLabels":{"agones.dev/fleet":"simple-udp"}}}}' -H "Content-Type: application/json" -X POST http://localhost:8001/apis/allocation.agones.dev/v1/namespaces/default/gameserverallocations +$ curl -d '{"apiVersion":"allocation.agones.dev/v1","kind":"GameServerAllocation","spec":{"required":{"matchLabels":{"agones.dev/fleet":"simple-game-server"}}}}' -H "Content-Type: application/json" -X POST http://localhost:8001/apis/allocation.agones.dev/v1/namespaces/default/gameserverallocations { "kind": "GameServerAllocation", "apiVersion": "allocation.agones.dev/v1", "metadata": { - "name": "simple-udp-v6jwb-cmdcv", + "name": "simple-game-server-v6jwb-cmdcv", "namespace": "default", "creationTimestamp": "2019-07-03T17:19:47Z" }, @@ -274,7 +274,7 @@ $ curl -d '{"apiVersion":"allocation.agones.dev/v1","kind":"GameServerAllocation }, "required": { "matchLabels": { - "agones.dev/fleet": "simple-udp" + "agones.dev/fleet": "simple-game-server" } }, "scheduling": "Packed", @@ -282,7 +282,7 @@ $ curl -d '{"apiVersion":"allocation.agones.dev/v1","kind":"GameServerAllocation }, "status": { "state": "Allocated", - "gameServerName": "simple-udp-v6jwb-cmdcv", + "gameServerName": "simple-game-server-v6jwb-cmdcv", "ports": [ { "name": "default", diff --git a/site/content/en/docs/Guides/local-game-server.md b/site/content/en/docs/Guides/local-game-server.md index 5c8fe83c39..1821bfdc79 100644 --- a/site/content/en/docs/Guides/local-game-server.md +++ b/site/content/en/docs/Guides/local-game-server.md @@ -31,8 +31,8 @@ spec: template: spec: containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 + - name: simple-game-server + image: gcr.io/agones-images/simple-game-server:0.1 ``` Once you save this to a file make sure you have `kubectl` configured to point to your Agones cluster and then run `kubectl apply -f dev-gameserver.yaml`. This will register your server with Agones. diff --git a/site/content/en/docs/Guides/troubleshooting.md b/site/content/en/docs/Guides/troubleshooting.md index f09124a645..4a5c28ca47 100644 --- a/site/content/en/docs/Guides/troubleshooting.md +++ b/site/content/en/docs/Guides/troubleshooting.md @@ -45,12 +45,12 @@ Depending on what is happening, you may want to run `kubectl describe Annotations: agones.dev/sdk-version: 1.0.0-dce1546 @@ -60,13 +60,13 @@ Metadata: Creation Timestamp: 2019-08-16T21:25:44Z Finalizers: agones.dev - Generate Name: simple-udp- + Generate Name: simple-game-server- Generation: 1 Resource Version: 1378575 - Self Link: /apis/agones.dev/v1/namespaces/default/gameservers/simple-udp-zqppv + Self Link: /apis/agones.dev/v1/namespaces/default/gameservers/simple-game-server-zqppv UID: 6818adc7-c06c-11e9-8dbd-42010a8a0109 Spec: - Container: simple-udp + Container: simple-game-server Health: Failure Threshold: 3 Initial Delay Seconds: 5 @@ -83,8 +83,8 @@ Spec: Creation Timestamp: Spec: Containers: - Image: gcr.io/agones-images/udp-server:0.21 - Name: simple-udp + Image: gcr.io/agones-images/simple-game-server:0.1 + Name: simple-game-server Resources: Limits: Cpu: 20m @@ -104,7 +104,7 @@ Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal PortAllocation 72s gameserver-controller Port allocated - Normal Creating 72s gameserver-controller Pod simple-udp-zqppv created + Normal Creating 72s gameserver-controller Pod simple-game-server-zqppv created Normal Scheduled 72s gameserver-controller Address and port populated Normal RequestReady 67s gameserver-sidecar SDK state change Normal Ready 66s gameserver-controller SDK.Ready() complete @@ -114,30 +114,30 @@ Events: The backing Pod has the same name as the `GameServer` - so it's also worth looking at the details and events for the Pod to see if there are any issues there, such as restarts due to binary crashes etc. -For example, you can see the restart count on the gcr.io/agones-images/udp-server:0.21 container +For example, you can see the restart count on the gcr.io/agones-images/simple-game-server:0.1 container is set to `1`, due to the game server binary crash ``` -root@6a71afd42291:/go/src/agones.dev/agones# kubectl describe pod simple-udp-zqppv -Name: simple-udp-zqppv +root@6a71afd42291:/go/src/agones.dev/agones# kubectl describe pod simple-game-server-zqppv +Name: simple-game-server-zqppv Namespace: default Priority: 0 PriorityClassName: Node: gke-test-cluster-default-590db5e4-4s6r/10.138.0.23 Start Time: Fri, 16 Aug 2019 21:25:44 +0000 -Labels: agones.dev/gameserver=simple-udp-zqppv +Labels: agones.dev/gameserver=simple-game-server-zqppv agones.dev/role=gameserver -Annotations: agones.dev/container: simple-udp +Annotations: agones.dev/container: simple-game-server agones.dev/sdk-version: 1.0.0-dce1546 cluster-autoscaler.kubernetes.io/safe-to-evict: false Status: Running IP: 10.48.1.80 -Controlled By: GameServer/simple-udp-zqppv +Controlled By: GameServer/simple-game-server-zqppv Containers: - simple-udp: + simple-game-server: Container ID: docker://69eacd03cc89b0636b78abe47926b02183ba84d18fa20649ca443f5232511661 - Image: gcr.io/agones-images/udp-server:0.21 - Image ID: docker-pullable://gcr.io/agones-images/udp-server@sha256:6a60eff5e68b88b5ce75ae98082d79cff36cda411a090f3495760e5c3b6c3575 + Image: gcr.io/agones-images/simple-game-server:0.1 + Image ID: docker-pullable://gcr.io/agones-images/simple-game-server@sha256:6a60eff5e68b88b5ce75ae98082d79cff36cda411a090f3495760e5c3b6c3575 Port: 7654/UDP Host Port: 7058/UDP State: Running @@ -173,7 +173,7 @@ Containers: cpu: 30m Liveness: http-get http://:8080/healthz delay=3s timeout=1s period=3s #success=1 #failure=3 Environment: - GAMESERVER_NAME: simple-udp-zqppv + GAMESERVER_NAME: simple-game-server-zqppv POD_NAMESPACE: default (v1:metadata.namespace) Mounts: /var/run/secrets/kubernetes.io/serviceaccount from agones-sdk-token-vr6qq (ro) @@ -198,20 +198,20 @@ Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s Events: Type Reason Age From Message ---- ------ ---- ---- ------- - Normal Scheduled 2m32s default-scheduler Successfully assigned default/simple-udp-zqppv to gke-test-cluster-default-590db5e4-4s6r + Normal Scheduled 2m32s default-scheduler Successfully assigned default/simple-game-server-zqppv to gke-test-cluster-default-590db5e4-4s6r Normal Pulling 2m31s kubelet, gke-test-cluster-default-590db5e4-4s6r pulling image "gcr.io/agones-mark/agones-sdk:1.0.0-dce1546" Normal Started 2m28s kubelet, gke-test-cluster-default-590db5e4-4s6r Started container Normal Pulled 2m28s kubelet, gke-test-cluster-default-590db5e4-4s6r Successfully pulled image "gcr.io/agones-mark/agones-sdk:1.0.0-dce1546" Normal Created 2m28s kubelet, gke-test-cluster-default-590db5e4-4s6r Created container Normal Created 114s (x2 over 2m31s) kubelet, gke-test-cluster-default-590db5e4-4s6r Created container Normal Started 114s (x2 over 2m31s) kubelet, gke-test-cluster-default-590db5e4-4s6r Started container - Normal Pulled 114s (x2 over 2m31s) kubelet, gke-test-cluster-default-590db5e4-4s6r Container image "gcr.io/agones-images/udp-server:0.21" already present on machine + Normal Pulled 114s (x2 over 2m31s) kubelet, gke-test-cluster-default-590db5e4-4s6r Container image "gcr.io/agones-images/simple-game-server:0.1" already present on machine ``` Finally, you can also get the logs of your `GameServer` `Pod` as well via `kubectl logs -c `, for example: ``` -root@6a71afd42291:/go/src/agones.dev/agones# kubectl logs simple-udp-zqppv -c simple-udp +root@6a71afd42291:/go/src/agones.dev/agones# kubectl logs simple-game-server-zqppv -c simple-game-server 2019/08/16 21:26:23 Creating SDK instance 2019/08/16 21:26:24 Starting Health Ping 2019/08/16 21:26:24 Starting UDP server, listening on port 7654 @@ -219,7 +219,7 @@ root@6a71afd42291:/go/src/agones.dev/agones# kubectl logs simple-udp-zqppv -c si ``` The above commands will only give the most recent container's logs (so we won't get the previous crash), but -you can use `kubectl logs --previous=true simple-udp-zqppv -c simple-udp` to get the previous instance of the containers logs, or +you can use `kubectl logs --previous=true simple-game-server-zqppv -c simple-game-server` to get the previous instance of the containers logs, or use your Kubernetes platform of choice's logging aggregation tools to view the crash details. #### kubectl events @@ -233,20 +233,20 @@ Therefore, even a `GameServer` or `Pod` resource is no longer available in the s all events across both the `GameServer` and its backing `Pod`, like so: ```shell script -root@c9a845c474c2:/go/src/agones.dev/agones# kubectl get events | grep simple-udp-v992s-jwpx2 -2m47s Normal PortAllocation gameserver/simple-udp-v992s-jwpx2 Port allocated -2m47s Normal Creating gameserver/simple-udp-v992s-jwpx2 Pod simple-udp-v992s-jwpx2 created -2m47s Normal Scheduled pod/simple-udp-v992s-jwpx2 Successfully assigned default/simple-udp-v992s-jwpx2 to gke-test-cluster-default-77e7f57d-j1mp -2m47s Normal Scheduled gameserver/simple-udp-v992s-jwpx2 Address and port populated -2m46s Normal Pulled pod/simple-udp-v992s-jwpx2 Container image "gcr.io/agones-images/udp-server:0.21" already present on machine -2m46s Normal Created pod/simple-udp-v992s-jwpx2 Created container simple-udp -2m45s Normal Started pod/simple-udp-v992s-jwpx2 Started container simple-udp -2m45s Normal Pulled pod/simple-udp-v992s-jwpx2 Container image "gcr.io/agones-images/agones-sdk:1.7.0" already present on machine -2m45s Normal Created pod/simple-udp-v992s-jwpx2 Created container agones-gameserver-sidecar -2m45s Normal Started pod/simple-udp-v992s-jwpx2 Started container agones-gameserver-sidecar -2m45s Normal RequestReady gameserver/simple-udp-v992s-jwpx2 SDK state change -2m45s Normal Ready gameserver/simple-udp-v992s-jwpx2 SDK.Ready() complete -2m47s Normal SuccessfulCreate gameserverset/simple-udp-v992s Created gameserver: simple-udp-v992s-jwpx2 +root@c9a845c474c2:/go/src/agones.dev/agones# kubectl get events | grep simple-game-server-v992s-jwpx2 +2m47s Normal PortAllocation gameserver/simple-game-server-v992s-jwpx2 Port allocated +2m47s Normal Creating gameserver/simple-game-server-v992s-jwpx2 Pod simple-game-server-v992s-jwpx2 created +2m47s Normal Scheduled pod/simple-game-server-v992s-jwpx2 Successfully assigned default/simple-game-server-v992s-jwpx2 to gke-test-cluster-default-77e7f57d-j1mp +2m47s Normal Scheduled gameserver/simple-game-server-v992s-jwpx2 Address and port populated +2m46s Normal Pulled pod/simple-game-server-v992s-jwpx2 Container image "gcr.io/agones-images/simple-game-server:0.1" already present on machine +2m46s Normal Created pod/simple-game-server-v992s-jwpx2 Created container simple-game-server +2m45s Normal Started pod/simple-game-server-v992s-jwpx2 Started container simple-game-server +2m45s Normal Pulled pod/simple-game-server-v992s-jwpx2 Container image "gcr.io/agones-images/agones-sdk:1.7.0" already present on machine +2m45s Normal Created pod/simple-game-server-v992s-jwpx2 Created container agones-gameserver-sidecar +2m45s Normal Started pod/simple-game-server-v992s-jwpx2 Started container agones-gameserver-sidecar +2m45s Normal RequestReady gameserver/simple-game-server-v992s-jwpx2 SDK state change +2m45s Normal Ready gameserver/simple-game-server-v992s-jwpx2 SDK.Ready() complete +2m47s Normal SuccessfulCreate gameserverset/simple-game-server-v992s Created gameserver: simple-game-server-v992s-jwpx2 ``` #### Other techniques @@ -270,11 +270,11 @@ same network namespace as the game server container to connect to via the SDK. The logs from this SDK server are also useful for tracking down issues, especially if you are having trouble with a particular `GameServer`. 1. To find the `Pod` for the `GameServer` look for the pod with a name that is prefixed with the name of the - owning `GameServer`. For example if you have a `GameServer` named `simple-udp`, it's pod could potentially be named - `simple-udp-dnbwj`. + owning `GameServer`. For example if you have a `GameServer` named `simple-game-server`, it's pod could potentially be named + `simple-game-server-dnbwj`. 2. To get the logs from that `Pod`, we need to specify that we want the logs from the `agones-gameserver-sidecar` container. To do that, run the following: - `kubectl logs simple-udp-dnbwj -c agones-gameserver-sidecar` + `kubectl logs simple-game-server-dnbwj -c agones-gameserver-sidecar` Agones uses JSON structured logging, therefore errors will be visible through the `"severity":"info"` key and value. diff --git a/site/content/en/docs/Reference/fleet.md b/site/content/en/docs/Reference/fleet.md index 73b45e2732..fd49cae704 100644 --- a/site/content/en/docs/Reference/fleet.md +++ b/site/content/en/docs/Reference/fleet.md @@ -66,8 +66,8 @@ spec: template: spec: containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 + - name: simple-game-server + image: gcr.io/agones-images/simple-game-server:0.1 ``` Since Agones defines a new @@ -105,25 +105,25 @@ The `spec` field is the actual `Fleet` specification and it is composed as follo Scale subresource is defined for a Fleet. Please refer to [Kubernetes docs](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#subresources). -You can use the following command to scale the fleet with name simple-udp: +You can use the following command to scale the fleet with name simple-game-server: ```bash -$ kubectl scale fleet simple-udp --replicas=10 -fleet.agones.dev/simple-udp scaled +$ kubectl scale fleet simple-game-server --replicas=10 +fleet.agones.dev/simple-game-server scaled ``` You can also use [Kubernetes API]({{< ref "/docs/Guides/access-api.md" >}}) to get or update the Replicas count: ``` -curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/fleets/simple-udp/scale +curl http://localhost:8001/apis/agones.dev/v1/namespaces/default/fleets/simple-game-server/scale ... { "kind": "Scale", "apiVersion": "autoscaling/v1", "metadata": { - "name": "simple-udp", + "name": "simple-game-server", "namespace": "default", - "selfLink": "/apis/agones.dev/v1/namespaces/default/fleets/simple-udp/scale", + "selfLink": "/apis/agones.dev/v1/namespaces/default/fleets/simple-game-server/scale", "uid": "4dfaa310-2566-11e9-afd1-42010a8a0058", "resourceVersion": "292652", "creationTimestamp": "2019-01-31T14:41:33Z" diff --git a/site/content/en/docs/Reference/fleetautoscaler.md b/site/content/en/docs/Reference/fleetautoscaler.md index f53aceff46..a6c94f1d75 100644 --- a/site/content/en/docs/Reference/fleetautoscaler.md +++ b/site/content/en/docs/Reference/fleetautoscaler.md @@ -47,7 +47,7 @@ kind: FleetAutoscaler metadata: name: webhook-fleet-autoscaler spec: - fleetName: simple-udp + fleetName: simple-game-server policy: # type of the policy - this example is Webhook type: Webhook diff --git a/site/content/en/docs/Reference/gameserver.md b/site/content/en/docs/Reference/gameserver.md index 8e0f4e0404..9028908efb 100644 --- a/site/content/en/docs/Reference/gameserver.md +++ b/site/content/en/docs/Reference/gameserver.md @@ -32,7 +32,7 @@ spec: # This will mean that users will need to lookup what port has been opened through the server side SDK. portPolicy: Static # The name of the container to open the port on. Defaults to the game server container if omitted or empty. - container: simple-udp + container: simple-game-server # the port that is being opened on the game server process containerPort: 7654 # the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic". @@ -86,8 +86,8 @@ spec: # Pod Specification spec: containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 + - name: simple-game-server + image: gcr.io/agones-images/simple-game-server:0.1 imagePullPolicy: Always ``` diff --git a/test/load/allocation/README.md b/test/load/allocation/README.md index 3d80e9f75d..b1d52aa7e2 100644 --- a/test/load/allocation/README.md +++ b/test/load/allocation/README.md @@ -1,6 +1,7 @@ This is a load test to determine Allocation QPS over time against a set of GameServers that are constantly being shutdown after a period. -This test creates a configured amount of GameServers at the initial step, switches them to Allocated state and finally shuts them down (`automaticShutdownDelayMin` flag in a simple-udp). +This test creates a configured amount of GameServers at the initial step, switches them to Allocated state and finally +shuts them down (`automaticShutdownDelayMin` flag in a simple-game-server). 1) Run kubectl apply -f ./fleet.yaml 2) Run `runAllocation.sh` script to perform this test. You can provide a number of runs as a parameter (3 is a default value). There is a 500 seconds pause after each run. diff --git a/test/load/allocation/allocationload.go b/test/load/allocation/allocationload.go index b927a7bda5..5506ce8876 100644 --- a/test/load/allocation/allocationload.go +++ b/test/load/allocation/allocationload.go @@ -37,7 +37,7 @@ func main() { } kubeconfig := flag.String("kubeconfig", filepath.Join(usr.HomeDir, ".kube", "config"), "kube config path, e.g. $HOME/.kube/config") - fleetName := flag.String("fleet_name", "simple-udp", "The fleet name that the tests will run against") + fleetName := flag.String("fleet_name", "simple-game-server", "The fleet name that the tests will run against") qps := flag.Int("qps", 1000, "The QPS value that will overwrite the default value") burst := flag.Int("burst", 1000, "The Burst value that will overwrite the default value") clientCnt := flag.Int("clients", 10, "The number of concurrent clients") diff --git a/test/load/allocation/fleet.yaml b/test/load/allocation/fleet.yaml index 8345e5783b..2ece0ef36d 100644 --- a/test/load/allocation/fleet.yaml +++ b/test/load/allocation/fleet.yaml @@ -15,7 +15,7 @@ apiVersion: "agones.dev/v1" kind: Fleet metadata: - name: simple-udp + name: simple-game-server spec: replicas: 100 template: @@ -26,8 +26,8 @@ spec: template: spec: containers: - - name: simple-udp - image: gcr.io/agones-images/udp-server:0.21 + - name: simple-game-server + image: gcr.io/agones-images/simple-game-server:0.1 resources: requests: memory: "64Mi" diff --git a/test/load/allocation/grpc/README.md b/test/load/allocation/grpc/README.md index 8a88f8149c..40a6b94190 100644 --- a/test/load/allocation/grpc/README.md +++ b/test/load/allocation/grpc/README.md @@ -14,7 +14,8 @@ Here are the few important things: ## Fleet Setting We used the sample [fleet configuration](./fleet.yaml) with some minor modifications. We updated the `replicas` to 4000. -Also w set the `automaticShutdownDelayMin` parameter to 10 so simple-udp game servers shutdown after 10 minutes (see below). +Also we set the `automaticShutdownDelayMin` parameter to 10 so simple-game-server game servers shutdown after 10 +minutes (see below). This helps to easily re-run the test without having to delete the game servers and allows to run tests continously. ```yaml @@ -30,10 +31,10 @@ kind: Fleet spec: containers: - args: - # We setup the simple-udp server to shutdown 10 mins after allocation + # We setup the simple-game-server server to shutdown 10 mins after allocation - -automaticShutdownDelayMin=10 - image: gcr.io/agones-images/udp-server:0.21 - name: simple-udp + image: gcr.io/agones-images/simple-game-server:0.1 + name: simple-game-server ... ``` @@ -63,9 +64,9 @@ finished: 2020-10-22 23:34:18.381396416 -0700 PDT m=+52.558592912 If some errors occurred, the error message will be printed: ``` started: 2020-10-22 22:16:47.322731849 -0700 PDT m=+0.002953843 -(failed(client=3,allocation=43): rpc error: code = Unknown desc = error updating allocated gameserver: Operation cannot be fulfilled on gameservers.agones.dev "simple-udp-mlljx-g9crp": the object has been modified; please apply your changes to the latest version and try again -(failed(client=2,allocation=47): rpc error: code = Unknown desc = error updating allocated gameserver: Operation cannot be fulfilled on gameservers.agones.dev "simple-udp-mlljx-rxflv": the object has been modified; please apply your changes to the latest version and try again -(failed(client=7,allocation=45): rpc error: code = Unknown desc = error updating allocated gameserver: Operation cannot be fulfilled on gameservers.agones.dev "simple-udp-mlljx-x4khw": the object has been modified; please apply your changes to the latest version and try again +(failed(client=3,allocation=43): rpc error: code = Unknown desc = error updating allocated gameserver: Operation cannot be fulfilled on gameservers.agones.dev "simple-game-server-mlljx-g9crp": the object has been modified; please apply your changes to the latest version and try again +(failed(client=2,allocation=47): rpc error: code = Unknown desc = error updating allocated gameserver: Operation cannot be fulfilled on gameservers.agones.dev "simple-game-server-mlljx-rxflv": the object has been modified; please apply your changes to the latest version and try again +(failed(client=7,allocation=45): rpc error: code = Unknown desc = error updating allocated gameserver: Operation cannot be fulfilled on gameservers.agones.dev "simple-game-server-mlljx-x4khw": the object has been modified; please apply your changes to the latest version and try again finished: 2020-10-22 22:17:18.822039094 -0700 PDT m=+31.502261092 ``` diff --git a/test/load/allocation/grpc/fleet.yaml b/test/load/allocation/grpc/fleet.yaml index 6005a743ab..50e8093bcf 100644 --- a/test/load/allocation/grpc/fleet.yaml +++ b/test/load/allocation/grpc/fleet.yaml @@ -33,10 +33,10 @@ spec: spec: containers: - args: - # We setup the simple-udp server to shutdown 10 mins after allocation + # We setup the simple-game-server server to shutdown 10 mins after allocation - -automaticShutdownDelayMin=10 - image: gcr.io/agones-images/udp-server:0.21 - name: simple-udp + image: gcr.io/agones-images/simple-game-server:0.1 + name: simple-game-server resources: limits: cpu: 20m diff --git a/test/load/locust-files/fleet_autoscaling.py b/test/load/locust-files/fleet_autoscaling.py index 46fefac196..432570e029 100644 --- a/test/load/locust-files/fleet_autoscaling.py +++ b/test/load/locust-files/fleet_autoscaling.py @@ -34,7 +34,7 @@ def scaleUpFleet(self): "apiVersion": "agones.dev/v1", "kind": "Fleet", "metadata": { - "generateName": "fleet-simple-udp", + "generateName": "fleet-simple-game-server", "namespace": "default" }, "spec": { @@ -56,10 +56,10 @@ def scaleUpFleet(self): "spec": { "containers": [ { - "name": "simple-udp", + "name": "simple-game-server", "image": ( "gcr.io/agones-images" - "/udp-server:0.5") + "/simple-game-server:0.1") } ] } @@ -117,10 +117,10 @@ def scaleUpFleet(self): "spec": { "containers": [ { - "name": "simple-udp", + "name": "simple-game-server", "image": ( "gcr.io/agones-images" - "/udp-server:0.5") + "/simple-game-server:0.1") } ] } @@ -171,10 +171,10 @@ def scaleUpFleet(self): "spec": { "containers": [ { - "name": "simple-udp", + "name": "simple-game-server", "image": ( "gcr.io/agones-images" - "/udp-server:0.5") + "/simple-game-server:0.1") } ] } diff --git a/test/load/locust-files/gameserver_allocation.py b/test/load/locust-files/gameserver_allocation.py index 66336e84f4..0697628380 100644 --- a/test/load/locust-files/gameserver_allocation.py +++ b/test/load/locust-files/gameserver_allocation.py @@ -125,10 +125,10 @@ def create_fleet(self, client, fleet_name, fleet_size): "spec": { "containers": [ { - "name": "simple-udp", + "name": "simple-game-server", "image": ( "gcr.io/agones-images" - "/udp-server:0.9"), + "/simple-game-server:0.1"), "resources": { "limits": { "cpu": "20m",