-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to StatefulSet #54
Comments
Good point... I can see the main pod has a volume attached, so indeed this wouldn't scale if we increase the replicas, unless the volume is mounted However, when I look at what's persisted in this volume, it seems to be essentially the static result of the compilation step at startup... In that case, this volume doesn't really need to be persisted, it can very well be an I think the only files that really need persistence are the In general I think we should try to use Deployment as much as possible over StatefulSets, as every new volume has a cost... |
It really contains data which is supposed to persist - user uploaded content (screenshots, fonts) or VCS data, see https://docs.weblate.org/en/latest/admin/config.html#data-dir for documentation. Some more insights on what is stored there is also available in WeblateOrg/weblate#2984 (comment). |
Like @nijel pointed out above, the data directory does hold the user-generated data so |
Yes, the filesystem has to be synchronous across Weblate instances |
Ah yes of course... indeed, in this case, if replication is expected, unless the application manages it, switching to StatefulSet will not be enough. |
Hi, we tested running multiple replicas, but ran into an issue, the css file is not always found (depending on which container the traffic is directed to), I suppose it can be fixed with session affinity, but it seems to be related to the these css files being located in |
You should run the same version in all replicas; otherwise things will break. /app/cache/static/CACHE/css is filled during container startup and does not need to be synced. |
what version do you mean? Afaik all versions are equal between containers. FYI, the css file names are different between containers, when I run |
Hmm, I thought that django-compressor generates stable names. This should be fixed... |
This makes it safe to deploy on multiple servers. See WeblateOrg/helm#54
This particular issue should be addressed by WeblateOrg/weblate@90fbea8. |
Thanks for the quick fix! |
Yes, it's safe. All file system accesses are lock protected using Redis, no file locks are used for that. |
This makes it safe to deploy on multiple servers. See WeblateOrg/helm#54
Hi @nijel Thanks for the fix. Do you maybe have an ETA until when this commit will be part of a new release? Currently we can not have Weblate HA on EKS because of this issue. With an active ChaosKube that randomly kills pods this is a nightmare. 😅 |
I've backported the patch to the Docker image in WeblateOrg/docker@ec90869, it will be available later today in |
is there any chance that this patch will also be released in a build with a version tag? |
It was released in Weblate 4.18.2, so it's already there. |
Sorry I missed that. Awesome, thanks a lot |
fyi: switched to most recent helm chart and weblate version and it seems to work now. Can now run multiple replicas without running into this css bug anymore |
I saw the official Helm chart the other day and one thing stood out — it models Weblate as a stateless Deployment rather than StatefulSet which is great for stateful services. As far as I know, Weblate is currently a stateful service and can't be scaled horizontally. We started using Weblate on Kubernetes way before the official Helm chart got released and we first modelled it as Deployment too but the upgrades were somewhat problematic and it kept failing when trying to re-attach persistent disk to the newly spun up container. We used the "Recreate" rollout strategy but it would still fail and then we switched over to StatefulSet and this issue's been gone ever since.
Anywya, the idea is, should we remodel Weblate as a StatefulService? Is there any specific reason why we're using the Deployment object? I'm assuming that you've already considered it and that there are some reasons that I might have not thought about.
Originally posted by @mareksuscak in WeblateOrg/weblate#4806
The text was updated successfully, but these errors were encountered: