✓ Solved

Having an issue connecting to a server running in Kubernetes

Anyone familiar with Debain/Kubernetes? I'm trying to switch server hosts to something that will allow me to scale up/down based on demand. Right now I just have X servers always online.

I found Agones, an open source auto scaler for Kubernetes, but I'm having issues with trying to follow their tutorial. I've got the node/pod running, but I cannot connect to it using netcat like their example

https://agones.dev/site/docs/getting-started/create-gameserver/

I don't know much about linux overall, and first time using Kubernetes, so not sure what the issue could be/how to resolve it. Haven't found much on Google for it so far

4 Replies

✓ Best Answer

The Linode Kubernetes Engine provides a simple "built-in" autoscaler. You simply go to your Linode Kubernetes Cluster and click on Autoscale Pool for any node pools that you want to autoscale. Just set the minimum and maximum number of nodes.

If you wish to use Agones, I would make sure you are not using the built-in autoscaler as they might not play well together.

I followed the instructions (without messing with the helm commands) provided in:

kubectl create namespace agones-system
kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.20.0/install/yaml/install.yaml

I then ran:

kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.20.0/examples/simple-game-server/gameserver.yaml

To get the game servers name and address and host port, I ran:

kubectl describe gameserver

Output:

Name:         simple-game-server-rhc46
Namespace:    default
Labels:       <none>
...
Spec:
 Container:  simple-game-server
 Health:
   Failure Threshold:      3
   Initial Delay Seconds:  5
   Period Seconds:         5
 Ports:
   Container:       simple-game-server
   Container Port:  7654
   Host Port:       7559
...
Status:
  Address:    50.116.62.60
  Node Name:  lke52175-81937-620425c2c9eb
...

I was then able to connect to the gameserver:

nc -u 50.116.62.60 7559
Hello, World!
ACK: Hello, World!
EXIT
ACK: EXIT

The gameserver was shutdown and destroyed upon exit.

Thank you for your reply, @hphillips! I need auto scaling to happen based on if a server is in use or not (any players connected), not based on things like CPU usage, so I don't think the built in auto scaler would work for my needs? Also the documentation was a little confusing on it saying things like it wouldn't automatically scale it up or down or something.

I just ran the exact same commands that you posted on a new cluster, but my nc call does this and freezes with no other data returned:

nc -v -u 45.79.165.106 7744
45.79.165.106 (45.79.165.106:7744) open

Does anyone have any ideas what I'm doing wrong? I still have not been able to figure out how to connect to the server using netcat.

It turns out it was working correctly all along. I just didn't realize "Hello, World!" was something I was supposed to type. I thought it was a message sent from the server after connecting.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct