docker icon indicating copy to clipboard operation
docker copied to clipboard

entrypoint.sh script: Add semaphore to prevent parallel installation of files in Kubernetes

Open HaleyACS opened this issue 5 years ago • 2 comments

Using this image for my kubernetes cluster @ home. Works really nice :)

Only caveat is that in case you deploy the image while using the same NFS persistent directory for all instances, they all install into the same NFS share at almost the same time. From experience, this screams to "cause" heavoc when murphy decides and I absolutely don't want it to happen.

Any chance we could add a semaphore to trigger the installer options? (Of course any other mitigation is welcome) First instance that gets the semaphore installs, the others wait for the semaphore to be released to continue operation. It could he combined with a version-check and/or date or status check to see if the installation was done right. We can link it to KUBERNETES_ENV == SET (that's when kubernetes is set).

HaleyACS avatar Nov 23 '20 08:11 HaleyACS

This is an (even more major) issue for updates as well.

I'm using the fpm-alpine image as replicated handlers. Now, if I want to update my installation, I first need to scale the pods down to 1 to make sure, only one container is running the update.

Some kind of "locking" the installation really would help here. I think, for installing and updating it would be the same.

hansingt avatar Dec 18 '20 06:12 hansingt

The container should not be copying the source files of the application around to begin with.

Still would want the semaphore to avoid running occ upgrade more than once.

especially-relative avatar Feb 19 '22 21:02 especially-relative

Fixed in #1760 & #1905

joshtrichards avatar Oct 21 '23 15:10 joshtrichards