Search code examples
kubernetesvncxserver

How to manually scale desktop applications in Kubernetes on-demand


I have a containerized legacy application using VNC as an XServer. I'd like to run this application in a Kubernetes cluster, and start an application instance on-demand, when a new user logs in the system.

I'd like to

  • scale the number of PODs on-demand and not automatically with the replicas property
  • provide unique host/port to the clients to connect to their own VNC server?

How can I achieve this in K8S?


Solution

  • Your question is a bit contradictory, since on-demand scaling is a variant of automatic scaling. Given your constraints you could create a custom application in which users request their connection data. Upon request your application talks to the kubernetes api and scales up the number of instances.

    You would use a headless service to get the list of endpoints and associate a specific endpoint to a user. Your application would reserve a specific port for that user. You then have to create a new nodeport or loadbalancer service to expose this port of your application that forwards to the chosen instance.

    After all this sounds like a lot of effort, perhaps your concept is not a good match for kubernetes.