<p>We are running our prod DBs within Docker which works out good.</p>

<p>Now we are going into managed K8s and putting eg elasticsearch into it which does not feel good at all. After the issues with the volumes were solved (with PersistentVolumeClaimTemplates) clustering hit us hard. The nodes of the cluster simply do not find each other (after hours of fiddling around with using a headless service in the elasticsearch configs).</p>

<p>So, I am guessing that it is not very wise to do that and we should keep DBs outside the K8s cluster on VMs managed eg by Ansible. </p>

<p>What is your opinion about this?</p>

<p>Some of my clusters come from as early as Kubernetes 1.2-alpha, back then it was obvious that the really statefull services (MySQL Galera cluster in my case was the primary one) need to be kept outside of kube cluster. That did not change for me much, even with 1.8 installed, my DB is still external. But it is also large and separated (makes sense to have just mysql on each of the hosts) neither would I use k8s features to upgrade it or limit resources.</p>

<p>This is in my opinion still a perfectly viable option, specialy for large data stores that make sense to be isolated / reserve full node capacity.</p>

<p>On the other habd, if you have a wordpress blog to deploy, it can be perfectly reasonable to have the db for it as a part of it's helm chart. Even in the case above, while prod has separate DB, stage and dev envs have a <code>--set devdb.enabled=true</code> ability that brigs up the database inside the kube cluster instead of connecting to an external one. Another example I have is prometheus, which I fully deploy on kubernetes. Although in both cases I did not have to struggle with clustering.</p>

<p>The bottom line is, that what suits your case best is the right solution for you :)</p>
