eerotal / LibreSignage

A free and open source digital signage solution.
BSD 3-Clause "New" or "Revised" License
674 stars 124 forks source link

The Docker image is hard to use on Kubernetes due to the volume #114

Open Qonstrukt opened 4 years ago

Qonstrukt commented 4 years ago

When running LibreSignage in Docker, one can use a named volume to retain the files in /var/www/html/data and still have a bound volume to retain those files between runs.

Kubernetes unfortunately doesn't have such functionality. Volumes mounted use the original content on the host, so the data folder becomes empty. This prevents you from logging in using the standard admin account for example. There are ways around this using an inittcontainer and what not, but this makes the initial setup a lot harder than it has to be.

If the image could be changed so the initial files in data are created on first startup this would make the image a lot more friendly to use.

If I can find some spare time I'll try to cook something up myself and submit a PR, but I just wanted to put it out here. 🙂

eerotal commented 4 years ago

Ah, that's something I didn't take into account. It shouldn't be too hard to create a simple PHP script that initializes the admin account when the web interface is accessed for the first time for example.

stblassitude commented 4 years ago

Kubernetes offers a number of drivers to have persistent data stored in the cluster. Which ones are available depends on the exact cluster configuration. See the documentation at https://kubernetes.io/docs/concepts/storage/persistent-volumes/ for Kubernetes in general, and the specific documentation for persistent volumes for your cluster. Typically, there is a default type configured, so just creating a persistent volume claim and mounting that in your pod will work.

Kubernetes would be pretty useless if it didn't provide persistent data storage facilities.