Sharding gitaly research
One of the main ways we plan to support scaling of gitaly is to horizontally scale it. Gitaly however is stateful, each shard is the only location where the repos are stored. This makes horizontal scaling more difficult than non-stateful services like unicorn.
We should ensure that gitaly
can be scaled, and is survivable across restarts.
One item in particular that we should consider is whether we should use a StatefulSet instead of a deployment. There are a few benefits:
- Pods will increase linearly, and if restarted come back with the same identifier. This may make it easier to know which projects are where.
- You can define a volumeClaim template, which may help with creating additional PV's that meet a certain template. For example, you may be able to pre-create n persistent disks manually and have them available as needed. I'm not sure this is possible with Deployments.
- Also the PV will not be deleted if a node is scaled down or deleted. It must be done manually.
Edited by Joshua Lambert