How to deploy desktop based application on kubernetes

3/13/2018

I want to deploy my desktop based application on Kubernetes. Can someone suggest some ways of doing it.

In Docker we used --net and --add-host for running same. But in Kubernetes we are not able to find any solution.

Please help!

-- shweta patel
kubernetes

1 Answer

3/13/2018

There are a bunch of desktop applications with dockerfiles to run on Linux Desktops. I am not sure if it is possible but the idea is to deploy Desktop-based(GUI applications) to kubernetes you need to consider a few things.

  1. You need to make sure kubernetes nodes are Desktops not the server otherwise it wont work.
  2. mount the node's x11 socket inside container running desktop application to allow x11 connection. --volume /tmp/.X11-unix:/tmp/.X11-unix
  3. export node's DISPLAY environment variable to container DISPLAY.

-e DISPLAY = unix$DISPLAY

Here is a docker-compose file I use at my Desktop.

version: '3.0'
services:
 eclipse:
  container_name: naeemrashid/eclipse
  volumes:
   - /tmp/.X11-unix:/tmp/.X11-unix
   - /home/$USER/containers/eclipse/workspace:/home/eclipse/workspace
  environment:
   - DISPLAY=unix$DISPLAY
-- captainchhala
Source: StackOverflow