-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot connect to a game server using Docker Desktop (with integrated K8s cluster or Minikube) #1990
Comments
A not too shabby workaround if you are on Windows and the multiple layers of virtualistion make it hard to get a direct connection - you could create a Service just for local development to point to a specific GameServer instance, like so, basically to act as a traffic tunnel for local development: apiVersion: v1
kind: Service
metadata:
name: agones-gameserver
spec:
type: LoadBalancer
selector:
agones.dev/gameserver: ${GAMESERVER_NAME}
ports:
- protocol: UDP
port: 7000 # local port
targetPort: ${GAMESERVER_CONTAINER_PORT} If you want to connect to a different |
@markmandel I'm trying to use your solution of using a kubernetes Service, but still not working for me. How did you connect to the Service after you created it? I tried connecting to all combinations of Service cluster-ip, external-ip, port, nodeport. |
Each local K8s has a way to lookup the local ip and port of the service as described above. From there it was a case of connecting to that address. https://minikube.sigs.k8s.io/docs/handbook/accessing/ I'm on Linux, so don't have access to Docker Desktop, but the same technique should work. https://medium.com/@lizrice/accessing-an-application-on-kubernetes-in-docker-1054d46b64b1 I assume this would still work as described. |
Any updates on this issue? Without this it makes developing with Agones much harder locally. Is the only solution to we have to manually edit this service to expose the port? Do you have any idea if this is a Minikube issue or an Agones issue? |
If the local K8s environment doesn't provide a way to connect directly to the node and hostPost, there isn't much we can do on our end. See: https://minikube.sigs.k8s.io/docs/handbook/accessing/ If you can find workarounds that are a better fit than the above, please provide them -- PRs on documentation are always appreciated. |
Slightly different answer to the topic, but still someone might be interested. By the way was also checking Agones install with K3D:
|
This includes: * Correct commands for the newer versions of minikube * Guidance on increasing cpu and/or memory as needed * Workarounds if one can't connect locally to a GameServer Closes googleforgames#1536 Closes googleforgames#1990
What happened:
I installed Agones using helm on the K8s cluster delivered with Docker Desktop (windows, using WLS2). My goal is to be able to test a local cluster on my dev machine (so no cloud).
I was able to integrate the SDK and start a game server correctly. I have the logs of the server and can see that the SDK is working. When I kubectl get gs I can see an IP and port and that the server status is READY
Unfortunately I cannot connect to this IP/Port from my game client (outside the cluster).
What you expected to happen:
To connect from my game client using the given ip/port (from a simple kubectl get gs).
How to reproduce it (as minimally and precisely as possible):
Install agones on docker desktop (WLS2) and follow the game server documentation page:
https://agones.dev/site/docs/getting-started/create-gameserver/
Or use your own server.
Anything else we need to know?:
Here is what I tried:
Note that I'm able to connect to a standard UDP Loadbalancer Service with docker desktop, so in that case the IP/Port of the service is correctly exposed.
Environment: Local
Agones version: agones.dev/v1
Kubernetes version 1.19
Install method (yaml/helm): helm
Others: Docker Desktop on Windows with WLS2
The text was updated successfully, but these errors were encountered: