Kubernetes Java Pods Socket communication

5/24/2018

I have been playing with Kubernetes and Docker, and I was trying to recreate a setup that I use. My old setup is multiple java game servers running, and I have them connected using netty and a main server. I wanted to change these to kubernetes' pods. Do I still need to use a main server for netty's socket communication? Or does kubernetes offer a native TCP Socket communication?

-- Ricardo Falcão
java
kubernetes

1 Answer

5/28/2018

I'm not sure but I'm guessing you're running a clustered application and one of the instances in the cluster is the designated leader/master. If it's designated in a static way then you might be able to use one Deployment for the leader and another for the workers so that you can scale separately. If it's dynamically-elected that's different (https://kubernetes.io/blog/2016/01/simple-leader-election-with-kubernetes/)

You can also run multiple containers in a single Pod. Or multiple apps in a Container. Then you don't get the benefits of the platform's facilities to scale up replicas in response to load. It depends on your reasons for porting. A link that may be of interest is https://github.com/PaulSandoz/jersey-netty-app/blob/master/Tutorial.md

-- Ryan Dawson
Source: StackOverflow