Is it possible to use filesystem driver with blue/green deployment?

I have loki running as a service in Nomad. The current loki is just running as a docker container with local directory mounted inside /loki path and everything loki needs to store is inside that path. Simple, but we do not need anything more.

I want to use canary deployment to have zero-downtime configuration upgrade. How canary deployment works - Nomad temporary runs two docker containers with the same path mounted. When the new instance has defined healthcheck green, the old instance is shut down.

Is it safe to run two instances of grafana loki using the same directory at the same time? Is there a locking mechanisms used to fight against concurrent accesses to files?

The documentation Filesystem | Grafana Loki documentation states that it is possible to have grafana loki in high availability mode with files on NFS. However, this does not clearly indicate if grafana loki uses locking to protect against concurrent accesses from multiple instances. Does it?

thanks! my experience with grafana loki has been great so far!

I haven’t tried this before, so I can’t say with 100% certainty. I think you may have conflict with WAL, if you have that enabled. I’d also encourage you to test it and find out, setup some sort of curl command and send a bunch during service refresh and see what happens.

In my opinion, if you are already running a single Loki instance, you are already disregarding high availability in general. If high availability in general isn’t critical, why go through the trouble to worry about that for a fraction of the service run time?