<p>The next version of CloudFoundry / Diego will offer native support for Docker containers which will be orchestrated across multible hosts [<a href="http://thenewstack.io/docker-on-diego-cloud-foundrys-new-elastic-runtime/" rel="noreferrer">link</a>].
This sounds very similar to Kubernetes.</p>

<p>Of course, the problem Kubernetes is trying to solve is more a generic, where CloudFoundry is more focussed on app development. However, for me it sounds both are heading into a similar direction and CloudFoundry is adding a lot more features on top of the plain orchestration.</p>

<p>So I'm wondering about use-cases where Kubernetes would add more value than CloudFoundry?</p>

<p>As both a CloudFoundry (past) and Kubernetes (present) commiter, I'm probably uniquely qualified to answer this one.</p>

<h2>PaaS-like</h2>

<p>I like to call CloudFoundry an "Application PaaS" and Kubernetes a "Container PaaS", but the distinction is fairly subtle and fluid, given that both projects change over time to compete in the same markets.</p>

<p>The distinction between the two is that CF has a staging layer that takes a (12-factor) user app (e.g. jar or gem) and a Heroku-style buildpack (e.g. Java+Tomcat or Ruby) and produces a droplet (analogous to a Docker image). CF doesn't expose the containerization interface to the user, but Kubernetes does.</p>

<h2>Audience</h2>

<p>CloudFoundry's primary audience is enterprise application devs who want to deploy 12-factor stateless apps using Heroku-style buildpacks.</p>

<p>Kubernetes' audience is a little broader, including both stateless application and stateful service developers who provide their own containers.</p>

<p>This distinction could change in the future:</p>

<ul>
<li>CloudFoundry could start to accept docker images (<a href="http://lattice.cf/docs/docker-image-examples/">Lattice accepts Docker images</a>).</li>
<li>Kubernetes could add an image generation layer (<a href="https://docs.openshift.org/latest/dev_guide/new_app.html#specifying-source-code">OpenShift does something like this</a>).</li>
</ul>

<h2>Feature Comparison</h2>

<p>As both projects mature and compete, their similarities and differences will change. So take the following feature comparison with a grain of salt. </p>

<p>Both CF and K8s share many similar features, like containerization, namespacing, authentication, </p>

<p>Kubernetes competitive advantages:</p>

<ul>
<li>Group and scale pods of containers that share a networking stack, rather than just scaling independently</li>
<li>Bring your own container</li>
<li>Stateful persistance layer</li>
<li>Larger, more active OSS community</li>
<li>More extensible architecture with replacable components and 3rd party plugins</li>
<li>Free web GUI</li>
</ul>

<p>CloudFoundry competitive advantages:</p>

<ul>
<li>Mature authentication, user grouping, and multi-tenancy support [x]</li>
<li>Bring your own app</li>
<li>Included load balancer</li>
<li>Deployed, scaled, and kept alive by BOSH [x]</li>
<li>Robust logging and metrics aggregation [x]</li>
<li>Enterprise web GUI [x]</li>
</ul>

<p>[x] These features are not part of Diego or included in Lattice.</p>

<h2>Deployment</h2>

<p>One of CloudFoundry's competitive advantages is that it has a mature deployment engine, BOSH, which enables features like scaling, resurrection and monitoring of core CF components. BOSH also supports many IaaS layers with a pluggable cloud provider abstraction. Unfortunately, BOSH's learning curve and deployment configuration management are nightmarish. (As a BOSH committer, I think I can say this with accuracy.)</p>

<p>Kubernetes' deployment abstraction is still in its infancy. Multiple target environments are available in the core repo, but they're not all working, well tested, or supported by the primary developers. This is mostly a maturity thing. One might expect this to improve over time and increase in abstraction. For example, <a href="https://docs.mesosphere.com/services/kubernetes/">Kubernetes on DCOS</a> allows deploying Kubernetes to an existing <a href="https://docs.mesosphere.com/">DCOS</a> cluster with a single command.</p>

<h2>Historical Context</h2>

<p>Diego is a rewrite of CF's Droplet Execution Agent. It was originally developed before Kubernetes was announced and has taken on more feature scope as the competitive landscape has evolved. Its original goal was to generate droplets (user application + CF buildpack) and run them in Warden (renamed Garden when rewritten in Go) containers. Since its inception it's also been repackaged as <a href="http://lattice.cf/">Lattice</a>, which is somewhat of a CloudFoundry-lite (although that name was taken by an <a href="https://github.com/cloudfoundry/cf-lite">existing project</a>). For that reason, Lattice is somewhat toy-like, in that it has deliberately reduced user audience and scope, explicitly missing features that would make it "enterprise-ready". Features that CF already provides. This is partly because Lattice is used to test the core components, without some of the overhead from the more complex CF, but you can also use Lattice in internal high-trust environments where security and multi-tenancy aren't as much of a concern.</p>

<p>It's also worth mentioning that CloudFoundry and Warden (its container engine) predate Docker as well, by a couple years.</p>

<p>Kubernetes on the other hand, is a relatively new project that was developed by Google based on years of container usage with BORG and Omega. Kubernetes could be thought of as 3rd generation container orchestration at Google, the same way Diego is 3rd generation container orchestration at Pivotal/VMware (v1 written at VMware; v2 at VMware with Pivotal Labs help; v3 at Pivotal after it took over the project).</p>
