<p>I currently have GitLab omnibus setup on Docker. I plan to have HA for the same by adding it to Kubernetes and have persistence using Gluster. I have played around configuring Kubernetes with Gluster. Now it's time to bring GitLab into Kubernetes. GitLab uses PostgreSQL as the default db.</p>

<p>My query is that to implement HA, should i<br>
a) split GitLab into GitLab application and PostgreSQL container, and then run both (Application and DB) in their own cluster of pods i.e., separate <em>deployments</em> of replicas of GitLab app and PostgreSQL?<br>
OR<br>
b) keep using the omnibus installer and just have replicas of this single, standalone container?</p>

<p>Does it really make any difference whether<br>
1) writes happen to a db cluster exposed via service to the GitLab app<br>
OR<br>
2) writes happening directly to the omnibus GitLab container (which has db within itself)</p>

<p>Just want to make sure that i don't unnecessarily end up making the setup complex. Having GitLab in Kubernetes along with Gluster already makes things a little complex. So does splitting app and db makes sense or just the omnibus setup will suffice? Concerned about concurrent writes to db.</p>

<p>According to <a href="http://docs.gitlab.com/ce/install/kubernetes/gitlab_omnibus.html#introduction" rel="nofollow noreferrer">http://docs.gitlab.com/ce/install/kubernetes/gitlab_omnibus.html#introduction</a> <strong>you should use dedicated Redis and PostgreSQL</strong> HA clusters. Option b) and 1)</p>

<p>For less downtime better to use <strong>PostgreSQL master-slave</strong> cluster (<a href="https://www.postgresql.org/docs/10/static/different-replication-solutions.html" rel="nofollow noreferrer">https://www.postgresql.org/docs/10/static/different-replication-solutions.html</a>) and <strong>Redis Cluster master-slave</strong> (<a href="https://redis.io/topics/cluster-tutorial" rel="nofollow noreferrer">https://redis.io/topics/cluster-tutorial</a>). "Note that the minimal (Redis) cluster that works as expected requires to contain at least three master nodes".</p>

<p>If you will use only GlusterFS to bring failover to PostgreSQL, you can get some errors requires manual repair when one DB instance crashes and another brings up. Like this: <a href="https://stackoverflow.com/questions/598200/how-do-i-fix-postgres-so-it-will-start-after-an-abrupt-shutdown">How do I fix Postgres so it will start after an abrupt shutdown?</a></p>
