<p>Would the following directory structure work?</p>

<p>The goal is to have Jenkins trigger off GitHub commits and run Multi-branch Pipelines that build and test containers. (I have everything running on Kubernetes, including Jenkins)</p>

<pre><code>/project
  .git
  README.md
  Jenkinsfile
  /docker_image_1
    Dockerfile
    app1.py
    requirements.txt
    /unit_tests
      unit_test1.py
      unit_test2.py
  /docker_image_2
    Dockerfile
    app2.py
    requirements.txt
    /unit_tests
      unit_test1.py
      unit_test2.py
  /k8s
    /dev
      deployment.yaml
    /production
      deployment.yaml
  /component_tests
    component_tests.py
</code></pre>

<ol>
<li>Is the k8s folder that has the deployment.yamls in the right place?</li>
<li>Are the test folders in good locations? The tests in "component_tests" will ideally be doing more end-to-end integrated testing that involve multiple containers</li>
<li>I see a lot of repos have Jenkins file and Dockerfile in the same directory level. What are the pros and cons of that?</li>
</ol>

<p>There's no good answer to this question currently. </p>

<p>Kubernetes provides a standard API for deployment, but as a technology it relies on additional 3rd party tooling manage the build part of the ALM workflow. There a lots of options available for turning your source code into a container running on Kubernetes. Each has it's own consequences for how your source code is organised and how a deployment might be invoked from a CI/CD server like Jenkins.</p>

<p>I provide the following collection of options for your consideration, roughly categorized. Represents my current evaluation list.</p>

<h2>"Platform as a service" tools</h2>

<p>Tooling the manages the entire ALM lifecycle of your code. Powerful but more complex and opinionated.</p>

<ul>
<li><a href="https://deis.com/workflow/" rel="nofollow noreferrer">Deis workflow</a></li>
<li><a href="https://www.openshift.org/" rel="nofollow noreferrer">Openshift</a></li>
<li><a href="https://fabric8.io/" rel="nofollow noreferrer">Fabric8 (See also Openshift.io)</a></li>
</ul>

<h2>Build and deploy tools</h2>

<p>Tools useful for the code/test/code/retest workflow common during development. Can also be invoked from Jenkins to abstract your build process.</p>

<ul>
<li><a href="https://github.com/Azure/draft" rel="nofollow noreferrer">Draft</a></li>
<li><a href="http://forge.sh/" rel="nofollow noreferrer">Forge</a></li>
<li><a href="http://kompose.io/" rel="nofollow noreferrer">Kcompose</a></li>
<li><a href="https://maven.fabric8.io/" rel="nofollow noreferrer">Fabric8 Maven plugin (Java)</a></li>
<li><a href="https://github.com/commercialtribe/psykube" rel="nofollow noreferrer">Psykube</a></li>
</ul>

<h2>YAML templating tools</h2>

<p>The kubernetes YAML was never designed to be used by human beings. Several initatives to make this process simpler and more standardized.</p>

<ul>
<li><a href="https://helm.sh/" rel="nofollow noreferrer">Helm</a></li>
<li><a href="http://ksonnet.heptio.com/" rel="nofollow noreferrer">Ksonnet</a></li>
</ul>

<h2>Deployment monitoring tools</h2>

<p>These tools have conventions where they expect to find Kubernetes manifest files (or helm charts) located in your source code repository.</p>

<ul>
<li><a href="https://keel.sh/" rel="nofollow noreferrer">Keel</a></li>
<li><a href="https://github.com/box/kube-applier" rel="nofollow noreferrer">Kube-applier</a></li>
<li><a href="https://github.com/weaveworks/kubediff" rel="nofollow noreferrer">Kubediff</a></li>
<li><a href="https://github.com/Eneco/landscaper" rel="nofollow noreferrer">Landscaper</a></li>
<li><a href="https://invisionapp.github.io/kit/" rel="nofollow noreferrer">Kit</a> </li>
</ul>

<h2>CI/CD tools with k8s support</h2>

<ul>
<li><a href="https://www.spinnaker.io/" rel="nofollow noreferrer">Spinnaker</a></li>
<li><a href="https://about.gitlab.com/" rel="nofollow noreferrer">Gitlab</a></li>
<li><a href="https://plugins.jenkins.io/kubernetes-ci" rel="nofollow noreferrer">Jenkins + Kubernetes CI plugin</a></li>
<li><a href="https://wiki.jenkins.io/display/JENKINS/Kubernetes+Plugin" rel="nofollow noreferrer">Jenkins + Kubernetes plugin</a></li>
</ul>
