Skip to content

Conversation

KAllan357
Copy link
Contributor

@KAllan357 KAllan357 commented Oct 3, 2024

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

I am using Agones in the "Out of Cluster Dev Server" use case - running my GameServer as a local process with a local Agones SDK Server. This works well, but when I want to run a 2nd GameServer process, I also need a second Agones SDK Server. I can configure the 2nd SDK Server to avoid port collisions using flags --http-port and --grpc-port, but ran into an error binding port 8080:

$ ./sdk-server.linux.amd64 --kubeconfig ~/.kube/config --pod-namespace default --gameserver-name my-gameserver-1 --address 0.0.0.0 --graceful-termination false --grpc-port 9367 --http-port 9368                                                                                                                                                                                                                                 
{"ctlConf":{"GameServerName":"my-gameserver-1","PodNamespace":"default","Address":"0.0.0.0","IsLocal":false,"LocalFile":"","Delay":0,"Timeout":0,"Test":"","TestSdkName":"","KubeConfig":"/home/kallan/.kube/config","GracefulTermination":true,"GRPCPort":9367,"HTTPPort":9368,"LogLevel":"debug"},"featureGates":"AutopilotPassthroughPort=true\u0026CountsAndLists=true\u0026DisableResyncOnSDKServer=true\u0026Example=false\u0026GKEAutopilotExtendedDurationPods=false\u0026PlayerAllocationFilter=false\u0026PlayerTracking=false\u0026PortPolicyNone=false\u0026PortRanges=false\u0026RollingUpdateFix=false\u0026ScheduledAutoscaler=false","message":"Starting sdk sidecar","severity":"info","source":"main","time":"2024-10-02T14:55:57.21948912-04:00","version":"1.43.0"}
...
{"error":"Could not listen on :8080: listen tcp :8080: bind: address already in use","gsKey":"default/my-gameserver-1","message":"","severity":"error","source":"*sdkserver.SDKServer","time":"2024-10-02T14:55:57.325936931-04:00"}             
{"message":"Could not listen on :8080: listen tcp :8080: bind: address already in use","severity":"error","stack":["agones.dev/agones/pkg/sdkserver.(*SDKServer).Run.func1\n\t/go/src/agones.dev/agones/pkg/sdkserver/sdkserver.go:279","runtime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"],"time":"2024-10-02T14:55:57.325968766-04:00"}

This PR adds a new flag - --health-port to give the sdk-server the ability to avoid a collision on 8080.

@github-actions github-actions bot added kind/bug These are bugs. size/S labels Oct 3, 2024
@KAllan357 KAllan357 changed the title add a flag to avoid a collision on port 8080 Add a flag to sdkserver to avoid a collision on port 8080 Oct 3, 2024
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 692e0142-b104-4fcf-8c87-8961366c3f4d

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

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

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4010/head:pr_4010 && git checkout pr_4010
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.44.0-dev-18919ef

@gongmax gongmax enabled auto-merge (squash) October 3, 2024 22:53
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: d831ca74-66d6-4b8c-87f2-65ab6738f5f5

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

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

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4010/head:pr_4010 && git checkout pr_4010
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.44.0-dev-bef86a8

@gongmax gongmax merged commit 8369eef into googleforgames:main Oct 4, 2024
4 checks passed
@KAllan357 KAllan357 deleted the sdk-server/configurable-healthcheck-port branch October 4, 2024 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug These are bugs. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants