Add documentation for HA setup #350
Reference in New Issue
Block a user
No description provided.
Delete Branch "refs/pull/350/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This should serve as an initial draft to collect information about HA.
I am not bound to the type or location of the information - feel free to move.
I thought putting it into the README will make the README too long - having a dedicated document for this topic seemed reasonable to me.
This content is mainly based on #205 and #206, especially the information by @lunny
and @viceice.
@lunny @viceice @justusbunsi @luhahn
Feel free to edit/propose changes, I am sure that not everything might be on point or I missed something.
WRT to listing the non-supported indexers: I thought it might be interesting to some people and encourage them eventually to add support - after realizing that
Any chance we could provide a toggle in values.yml to move the template from a StatefulSet to a Deployment? I'm willing to contribute the work there, but having multiple RWX PVCs (as in a multi-replica StatefulSet) != having a shared RWX PVC.
Also happy to contribute a bit to this guide, like updating some of the values.yml recommendations (
builtIn
is gone, adding in storage options like Rook for object and RWX storage, etc.). I think it might be nice to link to the existing.I would also like to see the aspirational indexers linked to issues proposing their support (existing already or otherwise).
What would be the advantage here? Or in other words, which current limitation would this solve?
In a StatefulSet, scaling the number of replicas scales the number of PVCs to align with the number of pods. That is, each pod in a StatefulSet replica gets a unique PVC (at least when configured with a volumeClaimTemplate, as in the case of the Gitea StatefulSet from this chart).
Moving Gitea backend services to those that scale easily is great, but moving to an RWX PVC for Gitea's repositories doesn't automatically allow us to scale the StatefulSet to access those repositories from multiple load-balanced instances. It would simple create a new PVC for the new replica, and you would have different copies of the
/data
-mounted PV, each with different data.StatefulSet is a great mechanism for scaling RWO storage PVCs alongside replicas of an application that handles clustering natively, often requiring some amount of consistent identity between instances of pods (where "0" might be a leader, and any replica higher than "0" might be a follower, but "0" can be replaced and remain as "0").
In the case of Gitea replicas, the configuration you're documenting is attempting to offload most of the functionality to external HA components (DB, queue, cache, blob store, etc.) and keep the basic Git repositories (stored in
/data/git/gitea-repositories
) shared between multiple replicas. That will not work with a StatefulSet, even with RWX storage.I think multiple stateful pods with mirrored RWO volumes compared to a central RWX is a choice and I see that some helm charts go this way.
Nothing prevents you or the chart from doing so but I think we should not tackle both at the same time. I also wonder if both should be supported at all within the chart, so far I have only seen charts which go with either one.
We're still early with HA here and my attempts are first of all to gather all important facts from various issues into a single document source.
Yes most must be outsourced to HA-ready components. The biggest issue is the code indexer as HA-ready ones often take many resources (e.g.
elasticsearch
).Can you elaborate what you mean by "this will not work"? Do you mean it would only work for stateless replicas but stateful ones would require unique RWO copies?
@solacelost I might have misunderstood your point earlier.
I agree that we should/must move from a StatefulSet to a stateless deployment to be able to use one central RWX PVC for repo storage.
This is a prerequisite we need to do in the chart before all the other points can be applied for a "real" HA experience.
@justusbunsi I'd like to get it merged for better visibility and simplified updates, i.e. having a start in the first place.
I opted for a seperate .md to not make the main README too long while at the same time having a dedicated place for this distinct topic.
@ -46,1 +32,3 @@
An alternative to the two options above for the `ISSUE_INDEXER` is `"db"`, however we recommend to just go with `meilisearch` in this case and to not bother the DB with indexing.
- [elasticsearch](https://bitnami.com/stack/elasticsearch/helm) (4-8 GB)
- [opensearch](https://artifacthub.io/packages/helm/opensearch-project-helm-charts/opensearch) (4-8 GB)
- **not supported yet**: [manticore](https://manticoresearch.com/blog/manticore-alternative-to-elasticsearch/) (faster than `elasticsearch` & friends, lower resource usage)
How should one read
friends
here? "Elasticsearch and similar apps" or "here me out, this uses lower resources"? The latter might be slang and could be removed, IMO.Now integrated in #437.
Pull request closed