agones
agones copied to clipboard
Can't connect to the game server example using minikube
I tried to build the agones environment by following the official guide steps, but I can't connect to the game server using minikube. Here are the details.
At first, I tried to connect to the game server directly.
kubectl get gs
NAME STATE ADDRESS PORT NODE AGE
simple-game-server-kj67x-2xgq8 Ready 192.168.49.2 7532 minikube 63m
kubectl get pods
NAME READY STATUS RESTARTS AGE
simple-game-server-kj67x-2xgq8 2/2 Running 0 67m
But connecting to the server using nc got no response.
nc -u 192.168.49.2 7532
Hello World!
Then I tried to connect to the server by service, as the guide suggests.
The service yaml is like this:
apiVersion: v1
kind: Service
metadata:
name: agones-gameserver
spec:
type: LoadBalancer
selector:
agones.dev/gameserver: simple-game-server-kj67x-2xgq8
ports:
- protocol: UDP
port: 7001 # local port
targetPort: 7654
kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
agones-gameserver LoadBalancer 10.96.60.254 <pending> 7001:31974/UDP 3m57s
Still no response was received.
nc -u 10.96.60.254 7001
Hello World!
Would anyone please give me a clue on this? By the way, my computer is Mac M1, and the minikube driver I used was Docker.