<p>so I have been building my application mostly as 12 factor app and now looking at the config part.</p>

<p>Right now as it stands I have separate config files for dev and production and through the build process we either build a dev or production image. The code is 100% the same the only thing that changes is the config.</p>

<p>Now I 100% understand that in a 12 factor app the config should come from external source such as: environment variables, or maybe a safe store like vault etc...</p>

<p>So what the various articles and blogs fail to mention about the config is the how is the config stored/processed. If the code is separated in it's own git repo and it has no config stored with it then how do we handle the config?</p>

<p>Do we store the actual config values on a separate git and then some how merge/push/execute those on the target environment (Kubernet config map, marathon JSON config, Vault, etc...) through the build process using some kind of trigger?</p>

user432024
<p>There is not a standard but what I've been observing is some common behaviors like:</p>

<ol>
<li><p><strong>Sensitive information</strong> never gets on versioning system, specially git which is a DCVS (you can clone the repo for other locations). If you don't follow, remember that our existing "security system" is based on the incapacity of read crypto info in a certain time, but in certain point you might be able to read the info. Usually on kubernetes I see operators, managing the service account across multiple namespaces and then other only referring the service account, tools like KMS, Cert manager, Vault and etc. are welcome </p></li>
<li><p><strong>Configuration</strong> like env vars, endpoints, are stored and versioned with their own "lifecycle". </p></li>
</ol>

<p><a href="https://12factor.net/config" rel="noreferrer">12factor</a> does not meant to separate the configuration of your app from your <strong>repository</strong>, instead suggest not to put into your <strong>app</strong> (like on your container or even binary distribution). </p>

<p>In fact if you want to use a separate repo only for config you can do it, but if you want to put aside your project source code the configuration, you can do it as well. It is more a decision based on the size of the project, complexity, segregation of duties and team context. (IMHO)</p>

<p>On my case of study for instance, makes sense to separate config on a dedicated repository as production environment has more than 50 cluster, which one with their own isolation stack, also there are different teams managing their own services and using common backing services (db, api, streams...). In my opinion as long as things gets more complex and cross-shared, makes more sense to separate config on independent repository, as there are several teams and resources over multiple clusters.</p>
