<p>Say that I have 5 apis that i want to deploy in a Kubernetes cluster, my question is simply what is the best practice to store the yaml files related to Kubernetes.  </p>

<p>In projects I've seen online, Kubernetes yaml files are just added to the the api project itself. I wonder if it makes sense to decouple all files related to Kubernetes in an entirely separate "project", and which is managed by VCS as a completely separated entity from the api projects themselves.  </p>

<p>This question arises since I'm currently reading a book about Kubernetes, on the topic namespaces, and considered it might be a good idea to have separate namespaces per environment (DEV / UAT / PROD), and it may make sense to have these files in a centralized "Kubernetes" project (unless it might be better to have a separate cluster per environment (?)).  </p>

html_programmer
<p>From Production k8s experience for CI/CD:</p>

<ul>
<li>One cluster per environment such as dev , stage , prod ( optionally per data centre )</li>
<li><p>One namespace per project</p></li>
<li><p>One git deployment repo per project</p></li>
<li>One branch in git deployment repo per environment</li>
<li>Use configmaps for configuration aspects</li>
<li>Use secret management solution to store and use secrets</li>
</ul>
