How to deal with application (Java) that listen random port (using erlang otp protocol) in Kubernetes

8/29/2017

I have a Java application that create thread on demand. Each thread listen a specific port. The application assign a random port choosen from an available tcp port to the thread when creating it.

So basically, when I want to communicate with this application, I send a message on a fixed port, the application answer me the port on which I'll be able to communicate with and then start the conversation.

This workflow rely on the Erlang/OTP protocol using this Java package : http://erlang.org/doc/apps/jinterface/java/index.html

I have put my application on a Docker container and know wants to create a Kubernetes service to make this application callable from other pods.

Problem is : since the port I'm able to communicate with the application is not fixed, I cannot simply configure a Kubernetes service using the classic spec.ports.

Is there a way, in Kubernetes, to declare a service that map an entire virtual IP (all port opened)?

-- Sébastien Le Gall
kubernetes

0 Answers