<p>I know that &quot;best practice&quot; questions are very subjective and not a good fit for StackOverflow, but I'm not sure where else to ask so I figured I'd give it a try here.</p>
<p>I'm working on building a microservice application. I plan on having one git repostiory per service. So something like:</p>
<ul>
<li>An auth service (stores users and password hashes, accepts a username and password as input, outputs a JWT)</li>
<li>A product list service (stores products, accepts a JWT and product name, outputs product information)</li>
<li>A comment service (stores product IDs with comments, accepts a product ID, outputs all comments for the product)</li>
<li>etc</li>
</ul>
<p>All of these services will run inside of a Kubernetes cluster. So for every service there will be a corresponding Deployment YAML file:</p>
<ul>
<li><code>auth-deployment.yml</code></li>
<li><code>products-deployment.yml</code></li>
<li><code>comments-deployment.yml</code></li>
<li>etc</li>
</ul>
<p>My question is: Should I create a separate &quot;devops&quot; repo which contains all of these YAML files (basically one place to see my entire infrastructure in one repository) or should each YAML file live with the code it deploys?</p>

stevendesu
<p>My approach is, I have created a separate repository that contains my all deployment YAML files.
I have applied CICD (Continues Integration and Continues Deployment) for my deployment. I mean I have integrated GitLab repository with Jenkins.
If I will change something in YAML and push into the git branch, Jenkins will detect it automatically and deploy it in the Kubernetes environment. So actually I no need to build jar and image because there are no code changes.
So I have created a separated repository and if there are changes in a YAML file, I manually pull those changes into the Kubernetes environment. Then I applied those changes by using Kubernetes <strong>apply</strong> command as below.</p>
<pre><code>Kubectl apply -f {your file path} 


  
</code></pre>
